IBM ILOG Scheduler User's Manual > Advanced Concepts > Using Transition Times and Costs > Problem Description > Setting Temporal Constraints

An activity in a job starts after the end of the preceding activity in the same job. Note that the maintenance operations are not explicitly modeled as an IloActivity. Rather, the transition time and transition cost are used to ensure that there is enough time and energy to execute the activity without explicitly representing the activity in the model.

  /* CREATE THE ACTIVITIES AND THE TEMPORAL CONSTRAINTS. */
  k = 0;
  for (i = 0; i < numberOfJobs; i++) {
    IloActivity previousTask;
    for (j = 0; j < numberOfResources; j++) {
      IloInt number = resourceNumbers[k];
      sprintf(buffer, "J%ldS%ldR%ldT%ld", i, j, number, types[k]);
      IloActivity task = MakeTask(model,
                                  resources[number],
                                  types[k],
                                  processingTimes[k],
                                  setupDurations[types[k]],
                                  buffer);
      if (j != OL)
        model.add(task.startsAfterEnd(previousTask));
      previousTask = task;
      k++;
    }
    model.add(previousTask.endsBefore(makespan));
  }
}