IBM ILOG Scheduler User's Manual > Integrated Applications > Incremental Scheduling: Using Scheduler with Multiple Problem Sub-models > Defining the Problem > Adding New Jobs

The source of the incrementality in this example is the arrival of a new job to be scheduled. In a real application, such an arrival may correspond to a new order from a customer. In our example, we add n new jobs, where n is the number of jobs in the underlying job shop problem. Since the original multicapacity scheduling problem has 3n jobs, the final problem contains 4n jobs.

Each new job is a variation of a job defined in the original problem. Initially, the resource requirements and durations of the new job are identical to the original job. However, to add some variety, we regenerate the duration and randomly permute the resource requirement of each activity. The durations are selected with uniform probability from the interval of durations of the original job, as shown in the following code.

  IloNum minDur = IloInfinity;
  IloNum maxDur = -IloInfinity;
  IloInt i;
  for(i = 0; i < numberOfJobs * numberOfResources; ++i) {
    if (existingDurations[i] < minDur)
      minDur = existingDurations[i];
    if (existingDurations[i] > maxDur)
      maxDur = existingDurations[i];
  }
  
  IloNum diff = maxDur - minDur + 1;
  IloNumArray durations(env, numberOfResources);
  for(i = 0; i < numberOfResources; ++i)
    durations[i] = randGen.getInt(IloTrunc(diff)) + minDur;

The resource requirements of the activities in the new job are randomly permuted.

  IloArray<IloDiscreteResource> resources(env, numberOfResources);
  i = 0;
  for(IloIterator<IloDiscreteResource> iter(env); iter.ok(); ++iter) {
    resources[i] = *iter;
    ++i;
  }
  
  // RANDOMLY PERMUTE RESOURCE REQUIREMENTS
  for(i = 0; i < 1000; ++i) {
    IloInt index1 = randGen.getInt(numberOfResources);
    IloInt index2 = randGen.getInt(numberOfResources);
    while (index1 == index2)
      index2 = randGen.getInt(numberOfResources);
    IloDiscreteResource tmp = resources[index1];
    resources[index1] = resources[index2];
    resources[index2] = tmp;
  }

The following table provides a summary of the example problems that we use in this chapter.

Table 37.1 Summary of the Example Problems
Underlying job shop instance 
Number of jobs in job shop instance 
Number of jobs in original multicapacity problem 
Number of jobs in final problem 
MT06 
18 
24 
MT10 
10 
30 
40 
MT20 
20 
60 
80