12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reading the DataThe first part of this application reads data from a file and fills matrices:Each line in the data file corresponds to an array in the matrix and thus represents all theinformation about activities for a given job.For each job, other arrays contain further information from the data file:●●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();jobDueDate contains the due date for each job;jobEarlinessCost contains the penalty for being too early for each job;● jobTardinessCost contains the penalty for being too late for each job.The matrix activityOnAResource contains the sets of activities that must be scheduledon the same resource. This information will be used to state resource constraints.Creating VariablesThe unknowns of the problem are the starting dates of the various activities. To representthese dates with Concert Technology modeling objects, the application creates a matrix ofnumeric 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 excludeinteresting solutions of the problem. In this example, it is set arbitrarily at 10000. The typeNumVarMatrix is defined as typedef IloArray NumVarMatrix;NumVarMatrix s(env, nbJob);for(j = 0; j < nbJob; j++){s[j] = IloNumVarArray(env, nbResource, 0.0, Horizon);}<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 369

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!