Decision Optimization

Decision Optimization

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

 View Only
  • 1.  loop dependency for declaration in CPLEX

    Posted Thu July 08, 2021 12:52 PM
    I declared an expression S[i][t][t2] of type float and i want to use its result in another expression that give me the minimum value between two (a parameter(p) and S )so i wrote : dexpr float minx= minl(p ,S[i][t][t2]);
    but i got an error said that there is loop dependency for declaration of S .

    Can some one know what can i do to correct it and thank you in advance.

    ------------------------------
    Siwar
    ------------------------------

    #DecisionOptimization


  • 2.  RE: loop dependency for declaration in CPLEX

    Posted Fri July 09, 2021 04:26 AM
    Hi,

    let me help with the syntax:

    range I=1..2;
    range T=1..3;
    
    dvar int x in 0..10;
    dvar int p;
    dexpr int S[i in I][t in T][t2 in T]=x;
    
    int i=1;
    int t=1;
    int t2=1;
    
    dexpr float minx= minl(p ,S[i][t][t2]);
    
    minimize minx;
    subject to
    {
      
    }​


    works fine

    regards



    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------