Topic
  • 2 replies
  • Latest Post - ‏2014-06-06T13:06:48Z by stathis_d
stathis_d
stathis_d
33 Posts

Pinned topic model cannot extract expressions

‏2014-06-06T09:23:39Z |

Hi guys, 

i'm working on the attached model and i  have one small problem / question. The model seems to work fine, however I would like to run it for  Period=1...3 and not 0...2, but every time that i change the Period to 1...3, it doesn't extract the expressions and I get errors that the variables are out of bound . I tried to modify some of the constraints but nothing seems to work, can someone help with that ? Thanks in advance. 

Attachments

  • AlexFleischer
    AlexFleischer
    1918 Posts

    Re: model cannot extract expressions

    ‏2014-06-06T12:40:47Z  

    Hi,

    you should not try to get values from array if you are out of range.

    For example, you do

    forall(i, j in Nodes,t in Period )
       y[i][i][0]==2;

    but

    y is defined in dvar int+   y[i in Nodes][j in Nodes][t in Period];

    So you should have 0 in Period

    which is true if Period is 0..2 but is not true if Period is 1..3

    You should try to fix your model.

    Regards

     

     

  • stathis_d
    stathis_d
    33 Posts

    Re: model cannot extract expressions

    ‏2014-06-06T13:06:48Z  

    Hi,

    you should not try to get values from array if you are out of range.

    For example, you do

    forall(i, j in Nodes,t in Period )
       y[i][i][0]==2;

    but

    y is defined in dvar int+   y[i in Nodes][j in Nodes][t in Period];

    So you should have 0 in Period

    which is true if Period is 0..2 but is not true if Period is 1..3

    You should try to fix your model.

    Regards

     

     

    You are right ! that was a stupid mistake, it works now ! thanks a lot for your help ! 

    Regards