Designing the Master Schedule for demand-adaptive transit systems