Optimal planning of a multi-station system with sojourn time constraints