IBM ILOG Scheduler User's Manual > Getting Started with Scheduler > Adding Alternative Resources > Define the Problem, Design a Model > Create the Resources

As in Example 6, we create the workers as an array of instances of IloUnaryResource. In this example we assign names to the workers, to make it easier to understand the solution.

const char* WorkerNames [] = {
  "joe",
  "jim1",
  "jim2",
  "jack"};

  /* CREATE THE RESOURCES. */
  IloInt nbOfWorkers = 4;
  IloUnaryResourceArray workers(env, nbOfWorkers);
  for (IloInt k = 0; k < nbOfWorkers; k++)
    workers[k] = IloUnaryResource(env, WorkerNames[k]);