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

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;
}