IBM ILOG Scheduler User's Manual > Getting Started with Scheduler > Using Reservoirs > Define the Problem, Design a Model > Define a Function for Building the Houses

The function MakeHouse describes the processing of building a house. It includes a parameter for the budget resource.

void MakeHouse(IloModel model,
               const IloNum* dur,
               const IloNum startMin,
               const IloNum endMax,
               const IloUnaryResourceArray workers,
               const IloReservoir budget,
               const IloNumVar makespan) 

The following lines of code define the five houses to be built. The earliest start and latest end dates are the origin and horizon of the schedule.

  /* CREATE THE ACTIVITIES AND CONSTRAINTS FOR THE HOUSES. */
  MakeHouse(model, durationsDesign1, 0, horizon, workers, budget, makespan);
  MakeHouse(model, durationsDesign1, 0, horizon, workers, budget, makespan);
  MakeHouse(model, durationsDesign2, 0, horizon, workers, budget, makespan);
  MakeHouse(model, durationsDesign2, 0, horizon, workers, budget, makespan);
  MakeHouse(model, durationsDesign3, 0, horizon, workers, budget, makespan);