ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Early Tardy Scheduling > Reading the Data

The first part of this application reads data from a file and fills matrices:

      IloEnv env;

      IntMatrix   activityOnAResource(env);
      NumMatrix   duration(env);
      IloNumArray jobDueDate(env);
      IloNumArray jobEarlinessCost(env);
      IloNumArray jobTardinessCost(env);

      f >> activityOnAResource;
      f >> duration;
      f >> jobDueDate;
      f >> jobEarlinessCost;
      f >> jobTardinessCost;

      IloInt nbJob      = jobDueDate.getSize();
      IloInt nbResource = activityOnAResource.getSize();

Each line in the data file corresponds to an array in the matrix and thus represents all the information about activities for a given job.

For each job, other arrays contain further information from the data file:

The matrix activityOnAResource contains the sets of activities that must be scheduled on the same resource. This information will be used to state resource constraints.