Originally posted by: HuiD
Hi, I want to preprocess the input the data. Like I have the code below
int N = ...; // the number of demands
tuple demand {
int index; //from 1 to N
int ts;
int te;
}
{demand} Dem = ...;
int overlap[1..N][1..N] = ...;
//preprocessing
execute {
for(var p, q in Dem) {
if( (p.ts<=q.ts) && (p.te>q.ts)) {
overlap[p.index][q.index] = 1;
}
else {
overlap[p.index][q.index] = 0;
}
}
}
When I run it, there is this "Bad declaration syntax." at "for(var p, q in Dem)". I don't know how to correct this, any ideas? Thanks,
Hui
#DecisionOptimization#OPLusingCPLEXOptimizer