ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Early Tardy Scheduling > Creating Variables

The unknowns of the problem are the starting dates of the various activities. To represent these dates with Concert Technology modeling objects, the application creates a matrix of numeric variables (that is, instances of IloNumVar) with bounds between 0 and Horizon, where Horizon is the maximum starting date for an activity that does not exclude interesting solutions of the problem. In this example, it is set arbitrarily at 10000. The type NumVarMatrix is defined as typedef IloArray<IloNumVarArray> NumVarMatrix;

    NumVarMatrix s(env, nbJob);
    for(j = 0; j < nbJob; j++){
      s[j] = IloNumVarArray(env, nbResource, 0.0, Horizon);
    }