Originally posted by: Tunemelo
Hi Philippe,
Thanks for your reply😊 Do you mean something like this:
// Step 2 Variable
dvar interval Step_2 [p in Products];
// Mode 1 - no breakdown of Step 2
// Ressource 1 for Step 2
dvar interval Step2 [p in Products] optional size Duration2[p];
// Ressource 2 for Step 2
...
// Mode 2 - breakdown of Step 2
dvar interval Step2ab [p in Products] optional;
// Mode 2 - Step 2a and Step 2b
// Ressource 1 for Step 2a
dvar interval Step2a [p in Products] optional size Duration2a[p];
// Ressource 2 for Step 2a
...
// Ressource 1 for Step 2b
dvar interval Step2b [p in Products] optional size Duration2b[p];
// Mode 1 or Mode 2 as alternatives for Step 2
forall (p in Products)
alternative (Step_2[p], all (p in Products) [Step2[p],Step2ab[p]]);
// Span 2ab over 2a and 2b
forall (p in Products)
span (Step2ab[p], all(p in Products) [Step2a[p],Step2a[p]));
// Step 2a before Step 2b
forall (p in Products)
endBeforeStart(Step2a[p],Step2b[p]);
forall (p in Products)
{
presenceOf(Step2ab[p])== presenceOf(Step2a[p]);
presenceOf(Step2ab[p])== presenceOf(Step2b[p]);
};
The alternative and the span constraints are not working like this as I tried to include both variables. Obviously that's not correct how I did it. Do I need to include an additional interval variable for this (to cumulate Step2 and Step2ab first)?
Did I understood you correct that you suggest to establish one interval variable for each resource in each mode (Mode 1: Step2, Mode 2: Step2a --> Step2b)? (There are completely different alternative resources for Step2, Step2a and Step2b= 10 in total)
Thank's for your help!😊
#DecisionOptimization#OPLusingCPOptimizer