Dear all,
Im trying to sum over my binary decision variable X(f,g,t) which equals 1 if family f cooks meal g on day t and 0 otherwise. I want at least 10 days between am family cooking twice in a month.
For example:
f1f17;
g1g30;
t1t20
Some of the families have to cook twice. To have a break between the two cooking days I used the following restriction which is working perfectly fine:
whatIwant(f,t)$(ord(t)>1).. Sum(g,X(f,g,t))+Sum(g,X(f,g,t+1))+Sum(g,X(f,g,t+2))+Sum(g,X(f,g,t+3))+Sum(g,X(f,g,t+4))+Sum(g,X(f,g,t+5))+Sum(g,X(f,g,t+6))+Sum(g,X(f,g,t+7))+Sum(g,X(f,g,t+8))+Sum(g,X(f,g,t+9)) =L= 1;
Wouldnt it be possible to formulate the equation this way also?
WhatItried(f).. Sum(t$( (ord(t) = ord(t)+1) and (ord(t) <= ord(t)+10) ), Sum(g,X(f,g,t))) =L= 1;
I tried it with every possible constellation of ord and $ but didnt manage to make it work.
Would someone please help me!
Best regards
Moritz