IBM ILOG Scheduler User's Manual > Advanced Concepts > Scheduling with Unary Resources: the Bridge Problem > Defining the Problem, Designing a Model > Optimization Criterion

Generally, the definition of a problem includes the definition of the optimization criterion (or of the multiple criteria) to consider. The bridge construction problem specifies a unique optimization criterion--the makespan of the project--equal to the end time of the activity PE (project end).

The function DefineModel takes a reference to the constrained makespan variable and sets it to the constrained variable representing the end time of activity PE.

The enforcement level IloMediumHigh indicates that the Scheduler will spend extra effort in enforcing the resource constraints.

IloModel
DefineModel(IloEnv env, IloNumVar& makespan)
{
  IloModel model(env);
  IloSchedulerEnv schedEnv(env);
  schedEnv.getResourceParam().setCapacityEnforcement(IloMediumHigh);
  IloInt horizon = 365;
  schedEnv.setHorizon(horizon);

  /* CREATE ACTIVITIES: PROJECT END. THE makespan POINTER IS SET TO
     THE END-TIME VARIABLE OF THE PROJECT END. */
  IloActivity PE = MakeActivity(model, "PE", 0);
  makespan = IloNumVar(env, 0, IloInfinity, ILOINT);
  model.add(PE.endsAt(makespan));


  /* ... */ 
  /* RETURN THE CREATED MODEL. */
  return model;