A learning model for the allocation of training hours in a multistage setting