Optimisation of energetic and reproductive gains explains behavioural responses to environmental variation across seasons and years. (18th March 2020)