Originally posted by: Puppy26
Paul,
Thanks for your feedback. I'm bit lost in your concept. I saw some example models in the OPL directory and some forum help, I have developed the model for opening and closing of depots but I still didnt get the answer I was looking for.
As said earlier, I have operations period of 5 years and 3 depots for an example. 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];
Please advise me how I should modify to get the results as I mentioned. For your reference, I have attached my code.
Many thanks!
#DecisionOptimization#MathematicalProgramming-General