I tried solving this problem enter image description here

Here is my cplex code

enter image description here

I have mentioned stored[month] as float+ but in the final result I get negative values. What is wrong with my model? enter image description here

  • 1
    $\begingroup$ Why in objective function you have $\rm demand \times 0.3$? Shouldn't be $\rm stored \times 0.3$? $\endgroup$
    – Mostafa
    Apr 15 '20 at 11:37
  • 2
    $\begingroup$ In the future, please use code blocks rather than screenshots. It makes it much easier for us to read, and also for us to copy and paste into our own systems to test and debug your code. $\endgroup$
    – LarrySnyder610
    Apr 15 '20 at 15:22

you get negative values because your model is relaxed by cplex since it is not feasible. You should debug it. Your

if (i==i)

looks very strange, I would change one i into 1

Plus to get help try to copy / paste code instead of screenshots

  • $\begingroup$ It was a mistake I changed it to if (i==1) , it worked , thanks $\endgroup$ Apr 15 '20 at 11:37

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .