• 1 reply
  • Latest Post - ‏2013-09-09T17:41:02Z by GGR
17 Posts

Pinned topic Combining two constraints

‏2013-09-06T20:37:21Z |

Hi all,

I have developed a constraint for opening/closing of depots. The constraint 

forall (d in Depots, y in 1..NbYears-1)
      sum (d in Depots)  Open [d][y]>= sum (d in Depots) Open [d][y+1]; opens the depots in the beginning and close the depots on the last time period(y) and
the other constraint 


forall (d in Depots)
     sum (d in Depots) Open [d]==2; exactly opens two depots during a particular time period.


Could some one help me how to combine these two parameters so that  my ideally solution should be two depots should be opened on all the time period and rest of the depots should be closed on the last time period (y).

Any clue or tips will be highly appreciated. Many thanks!



  • GGR
    35 Posts

    Re: Combining two constraints


    Hi Puppy


    Your question is not precise enough. I suggest you mathematically define the different rules you want to apply on your problem. Then it will be possible to write the best possible correct Constraint Programming model.


    Hope that helps