The constructor for the class IloActivity
and the member functions startsAfterStart
, startsAfterEnd
, and endsAfterStart
let us represent the activities and temporal constraints of the problem. The following function, MakeActivity
, will associate a name with each activity.
IloActivity
MakeActivity(IloModel model,
const char* name,
IloInt duration)
{
IloEnv env = model.getEnv();
IloActivity activity(env, duration, 0, name);
IloNumExpr startVar = activity.getStartExpr();
IloNumExpr endVar = activity.getEndExpr();
NameVariable(startVar, name, "start");
NameVariable(endVar, name, "end");
return activity;
}