A neural network model for adaptive online time allocation