IBM ILOG Scheduler User's Manual > Integrated Applications > Scheduling with Alternative Resources: Interleaving Resource Allocation and Scheduling Decisions > Defining the Problem, Designing a Model > Generating the Data for the Alternative Resources

There are three important points about how the alternative resources are assigned. First, as mentioned above, the resource and processing time defined in the original job shop model are preserved in one of the alternatives. Second, the resource alternatives are generated such that the original resource requirement is replaced by an alternative resource set. That set contains two resources: the original resource defined in the job shop problem instance and another resource chosen with uniform probability from the other resources in the original job shop problem. This means that all the activities which required resource R0 in the original problem now require either R0 or another resource, for example, R5.

  /* CREATE THE ALTERNATIVE RESOURCE SETS */
  env.out() << "Creating resource sets" << endl;
  IloInt *altResourceNumbers = new (env) IloInt[numberOfResources];
  IloAltResSet *altResSets = 
    new (env) IloAltResSet[numberOfResources];
  for (j = 0; j < numberOfResources; j++) {
    altResSets[j] = IloAltResSet(env);
    altResSets[j].add(resources[j]);
 
    // RANDOMLY PICK ANOTHER RESOURCE TO BE IN THE SET
    assert(numberOfResources > 1);
    IloInt index = randomGenerator.getInt(numberOfResources);
    while(index == j)
      index = randomGenerator.getInt(numberOfResources);
 
    altResSets[j].add(resources[index]);
    altResourceNumbers[j] = index;
    env.out() << "Set #" << j << ":\t" << resources[j].getName()
              << " " << resources[index].getName() << endl;
  }
 

The final point about the model generation is that the new processing time for an activity is assigned to be equal to or greater than the processing time defined in the original job shop instance. That is, the original processing time and resource are still possible for an activity. If, however, the other resource is chosen, the processing time of the activity will be equal to or greater than defined in the original problem instance.

  /* CREATE THE ALTERNATIVE DURATIONS */
  IloNum *altDurations = new (env) IloNum[numberOfActivities];
  for(k = 0; k < numberOfActivities; k++) {
    IloNum multiplier = 1.0 + (randomGenerator.getFloat() / 2.0);
    altDurations[k] = IloCeil(multiplier * durations[k]);
  }

This is a useful property as it guarantees that the optimal solution to the original job shop problem instance is an upper bound on the optimal solution to the alternative resource problem. Indeed, because the processing time is larger when the resource alternative not in the original job shop problem is selected, we can expect this to be quite a good upper bound.