Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

CPLEX cannot extract expression

  • 1.  CPLEX cannot extract expression

    Posted Sun May 19, 2013 12:34 PM

    Originally posted by: 5NK7_Thomas_Cibils


    Hi all,

     

    I'm a beginner with CPLEX and I have some troubles with it. I just don't get why it doesn't work, it would be nice to help me. I have the following problem : CPLEX tells me that he can't extract expression :

     

     

       forall( s in Stations, i in Headway, t in Time : t>= i) 
           y[s][t] + y[s][t+i] <= 1;

     

    Stations, Headway and Time are defined like that :

     

     range Stations = 1..49;
     range Time = 0..720;
     range Headway = 1..2;

     

    I think it must be a quite simple problem, but I just don't get it. Could you explain me please ?

    Thanks 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX cannot extract expression

    Posted Sun May 19, 2013 05:56 PM

    You did not specify how y is declared. My guess is that the second index runs over Time, in which case when t = 720 in your forall statement the index t+i is out of bounds.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX cannot extract expression

    Posted Mon May 20, 2013 05:53 AM

    Originally posted by: 5NK7_Thomas_Cibils


    Hi,

     

    First, thanks for your answer ! It's nice to get some help :) y is defined like that :

     dvar int+ y[Stations][Time];

     

     

    and yes, I put a wrong condition, thanks. Now I have the following code, and it works.

     

    int maxRangeTime = 720

     range Time = 0..maxRangeTime;

     

       forall( s in Stations, i in Headway, t in Time : t + i <= maxRangeTime) 
           y[s][t] + y[s][t+i] <= 1;

    #CPLEXOptimizers
    #DecisionOptimization