Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Using OPL functions in postprocessing tuple

  • 1.  Using OPL functions in postprocessing tuple

    Posted 10/18/17 06:04 AM

    Originally posted by: Birome


    Hi,

     

    I would like to know how to use OPL functions in postprocessing tuples.

     

    For exemple  :

    //----------------------------------- POST-PROCESSING -----------------------------------------------------------------------------


    ....

    tuple TOTALDISTANCE {
       float totaldistance ;
    }

    TOTALDISTANCE totalDistance = <ftoi(expression)>;

    When using the model in docloud, i get error.

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Using OPL functions in postprocessing tuple

    Posted 10/18/17 06:12 AM

    Hi,

    do not forget to round before ftoi:

    dvar float x;
     subject to
     {
      x==0.75;
     }
     
     
    tuple TOTALDISTANCE {
       float totaldistance ;
    }

    TOTALDISTANCE totalDistance = <ftoi(round(x))>;
    execute
    {
    writeln(totalDistance);
    }

    gives

    <1>

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Using OPL functions in postprocessing tuple

    Posted 10/18/17 08:53 AM

    Originally posted by: Birome


    Thanks Alex !

     

    I needed another function but not round()...But i get the idea and i fix my problem.

     

    Thanks for your answer.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer