Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Error: OPL cannot extract expression

  • 1.  Error: OPL cannot extract expression

    Posted Mon March 06, 2017 08:15 PM

    Originally posted by: MVigneshwar


    Hi,

    I am trying to model a problem in CPLEX wherein I get the error OPL cannot extract expression in constraints con07a, con07b, con08.

    I have attached the model, data and excel file. Can someone help me find the problem? 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Error: OPL cannot extract expression

    Posted Wed March 08, 2017 03:01 AM

    You seem to have out of bounds.

    If you rewrite

    forall(i in I,j in J, t in T:t-1 in T)
          con07a:        //Find the maximum of two ready times and uses z to store info
              z[i][j][t]*(s[i][j][t-1]-sum(p in P,h in H) X[i][j][t][h][p]*r[p])
                      +(1-z[i][j][t])*(sum(p in P,h in H) X[i][j][t][h][p]*r[p]-s[i][j][t-1])>=0;
          
        forall(i in I,j in J, t in T:t-1 in T)
          con07b:        //The time before ambulance becomes available for the next trip
              s[i][j][t]>=z[i][j][t]*s[i][j][t-1]+(1-z[i][j][t])*(sum(p in P,h in H)X[i][j][t][h][p]*r[p])+
                              2*sum(p in P,h in H)X[i][j][t][h][p]*d[h];    
        
         forall(p in P)
           con08:        //Lateness
                L[p]==sum(i in I, j in J, t in T, h in H) X[i][j][t][h][p]*(v[p][i]-s[i][j][t]+d[h]);

    The out of bounds should go away

    Then you have to solve other issues and I attached the new file.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Error: OPL cannot extract expression

    Posted Wed March 08, 2017 08:22 AM

    Originally posted by: MVigneshwar


    Thanks, this is great help. 

    The program is running currently and I can proceed further. Thanks again


    #DecisionOptimization
    #OPLusingCPLEXOptimizer