Optimal size and specialization in constant and fluctuating environments: an energy-time approach.