Write generation data to file. Add max energy for beaver.