I want to assign a value of either 0 or 1 to each value in unitLateness depending on if the completion time is greater than the due date. I'm not sure how the syntax should work as I am new to CPLEX.
using CP;
int numberOfJobs = ...;
range jobIndices = 1..numberOfJobs;
int p[jobIndices] = ...;
int dueDate[jobIndices] = ...;
dvar interval job[j in jobIndices] size p[j];
dvar sequence machine in all (j in jobIndices) job[j];
dexpr int completionTimes[j in jobIndices] = endOf(job[j]);
dexpr int unitLateness[j in jobIndices]= if(completionTimes[j]>dueDate[j]) = 0 else =1;
//data file
numberOfJobs = 8;
p=[ 8,2,3,6,3,5,6,2];
dueDate=[ 8,11,14,15,17,19,21,21];
------------------------------
Michael Morrissey
------------------------------
#DecisionOptimization