Graded allocation between vegetative and reproductive growth for annual plants in growing seasons of random length