0

How can I formulate my model that it undertakes a maintenance at 450 and a cleaning at 150?

forall(w in W, t in T, s in S, p in P, m in M)  
   (450<=hub[m][w][t][s])<=(b_maint[w][m][t][s]==1);

forall(w in W, t in T, s in S, p in P, m in M)  
   (hub[m][w][t][s]>=150)<=(b_clean[w][m][t][s]==1);

I also want that after my maintenance the hub is set back to 0 (hub is my production quantity) Is this formulation right?.

forall(w in W, t in T, s in S, p in P, m in M)  
   (b_maint[w][m][t][s]==1)==(hub[m][w][t][s]==0);

And can i also model bounds like this:

forall(w in W, t in T, s in S)  
   (135<=sum(p in P, m in M)r_x[m][w][p][t][s] && sum(p in P, m in M)r_x[m][w][p][t][s]<=185)==(b_clean[w][t][s]==1);

I tried it also already like this:

(135<=sum(p in P, m in M)r_x[m][w][p][t][s] <=185)==(b_clean[w][t][s]==1);

but that doesn't work either...

Richard
  • 56,349
  • 34
  • 180
  • 251
NadineL
  • 1
  • 1
  • 5

2 Answers2

0

You may use logical constraints:

(x==1) => (y<=2);

This means if (x==1) then y will be less than 2.

You may also use equivalence:

(x==3) == (z>=3)
halfer
  • 19,824
  • 17
  • 99
  • 186
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15
  • Is that not how i did it? If the production (hub) is >= 450, the maintenance has to be carried out (binary b_maint==1)? Or did i make a mistake? – NadineL Nov 06 '18 at 09:14
-1

you wrote

forall(w in W, t in T, s in S, p in P, m in M)    
   (450<=hub[m][w][t][s])<=(b_maint[w][m][t][s]==1);

which you could have written

forall(w in W, t in T, s in S, p in P, m in M)    
   (450<=hub[m][w][t][s])=>(b_maint[w][m][t][s]==1);

=> means IMPLY

Is that what you meant ? Maybe what you meant is the inverse constraint:

forall(w in W, t in T, s in S, p in P, m in M)    
       (b_maint[w][m][t][s]==1)=>(450<=hub[m][w][t][s]);
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15