Originally posted by: Shilpi1991
Hi,
I am trying to solve a job shop scheduling problem for 90 jobs and 26 machines, using the standard example sched_jobshop that uses constraint programming, but I am unable to represent the data from tuple Ops in an excel file and read from there, is it possible How ?
Also how to account for floating processing times, when I declare pt as float it gives error on dvar Interval ivts
using CP;
int nbJobs = ...;
int nbMchs = ...;
range Jobs = 0..nbJobs-1;
range Mchs = 0..nbMchs-1;
// Mchs is used both to index machines and operation position in job
tuple Operation {
int mch; // Machine
int pt; // Processing time
};
Operation Ops[j in Jobs][m in Mchs]=...;
dvar interval itvs[j in Jobs][o in Mchs] size Ops[j][o].pt;
dvar sequence mchs[m in Mchs] in all(j in Jobs, o in Mchs : Ops[j][o].mch == m) itvs[j][o];
execute {
cp.param.FailLimit = 10000;
}
minimize max(j in Jobs) endOf(itvs[j][nbMchs-1]);
subject to {
forall (m in Mchs)
noOverlap(mchs[m]);
forall (j in Jobs, o in 0..nbMchs-2)
endBeforeStart(itvs[j][o], itvs[j][o+1]);
}
execute {
for (var j = 0; j <= nbJobs-1; j++) {
for (var o = 0; o <= nbMchs-1; o++) {
write(itvs[j][o].start + " ");
}
writeln("");
}
}
#DecisionOptimization#OPLusingCPOptimizer