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

The function MakeHouse describes the processing of building a house. A parameter specifies that workers from the alternative resource set can be used to build the house.

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

The following lines of code define the five houses to be built. The earliest start and latest end dates for the first, second, and fifth houses are the origin and horizon of the schedule, but the third and fourth houses have an earliest start date of 5 and a latest end date of 57.

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