Topic
  • 1 reply
  • Latest Post - ‏2013-09-09T17:38:51Z by GGR
Puppy26
Puppy26
17 Posts

Pinned topic constraint for opening/closing of depots

‏2013-09-04T19:17:08Z |

Hi all,

I need some help in developing a constraint for opening and closing of depots.

say for an example, I have operations period of 5 years and 3 depots. I want to develop a constraint in which 2 depots are opened  on all the 5 years and 1 depot should be opened on first 3 years and on the 4th and 5th year, it should be closed. Ideally the result should be

Name        Year 1     Year 2       Year 3        Year 4       Year 5
Depot1      Open       Open         Open          Open         Open
Depot 2     Open       Open         Open          Open         Open
Depot 3     Open       Open         Open          Closed       Closed

 

Right now, my constraint looks like this 

forall (d in Depots, y in 1..NbYears-1)
    Depotstaysclosed:
      Open [d][y]<= Open[d] [y+1]; but I'm not getting the desired result with this constraint.

Please advise me how I should modify to get the results as I mentioned. For your reference, I have attached my code.

Many thanks!

Attachments

Updated on 2013-09-05T08:05:11Z at 2013-09-05T08:05:11Z by Puppy26
  • GGR
    GGR
    39 Posts

    Re: constraint for opening/closing of depots

    ‏2013-09-09T17:38:51Z  

    Hi Puppy

     

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

    Hope that helps