Reputation: 81
I want to model a constraint where I want to say if a mode mode1
is scheduled on a sequence before another mode mode2
then a mode mode3
on a parallel working machine (so in an other sequence) cannot be started before the end of mode1
in an other sequence. So more or less I want to code an if (before...) block for that. How does it work correctly?
forall(m1 in Modes, m2 in Modes, m3 in Modes:
m1.opId==1 && m2.opId==2 &&
m3.opId==3 && m1.mch==m2.mch==1) {
if (before(mchs[1], modes[m1], modes[m3]) == 1) {
endBeforeStart(modes[m1],modes[m2);
}
;}
Upvotes: 2
Views: 152
Reputation: 446
Of course, you could post a constraint like (H is a large number):
(endOf(mode1,H) <= startOf(mode2,-H)) => (endOf(mode1,-H) <= startOf(mode3,H))
Explanation:
(endOf(mode1) <= startOf(mode2)) => (endOf(mode1) <= startOf(mode3))
mode1
or mode2
is absent, because of the constants H
, the left side of the implication is false, so it does not constrain mode3mode1
or mode3
is absent, the right side of the implication is true, so it does not constrain mode2
Now, if you have many triplets (mode1,mode2,mode3)
on which this constraint holds, it will be very useful to consider a more global formulation that also exploits other constraints of the problem: what do mode2
and mode3
have in common so that if mode2
is executed after mode1
then mode3
also needs to be executed after? Is there some other temporal dependency between mode2
and mode3
? Are there some logical constraints underneath (like presenceOf(mode1)==presenceOf(mode2)
) ? etc.
In fact, the definition of the problem is still not clear to me. Let me summarize my understanding :
Now what is still not clear:
Upvotes: 1