1
$\begingroup$

So I want to define multiple sequences (an array of them). I have this:

dvar interval casy[d in 1..Domy][ukol in Ukoly] size Trvani[ukol];

dvar sequence S[d in 1..Domy] in i in casy[d];

I get an error: Cannot use domain type dvar interval[][Ukoly] for dvar sequence. But when I use:

dvar interval casy[ukol in Ukoly] size Trvani[ukol];

dvar sequence S in i in casy;

everything just runs fine. Also, when I use

dvar interval casy[d in 1..Domy][ukol in Ukoly] size Trvani[ukol];

dvar sequence S[d in 1..Domy] in i in casy;

it works, but the sequences are for all the intervals, which I dont want. I want to have different sequences separately for each array of intervals, indexed by d.

I just can't understand why would it use the array of intervals when I declare it normally, but would complain when I pull the same exact interval from an array by its index.

Is there something I am missing?

$\endgroup$
2
$\begingroup$

in the sched_sequence example in OPL CPLEX you have an example of array of sequences:

dvar sequence workers[w in WorkerNames] in
    all(h in Houses, t in TaskNames: Worker[t]==w) itvs[h][t] 

that should help you

regards

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.