Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  endEval on a stepwise function

    Posted 12/23/16 08:07 AM

    Originally posted by: DavidGravot


    Hi

    I can see in Java Api, endEval api is requiring a 

    IloNumToNumSegmentFunction
    
    
    public IloNumExpr endEval(IloIntervalVar a
    , IloNumToNumSegmentFunction f
    , double absVal) 
    throws IloException
    

    This function refers to piecewise linear function. 

    I would like to query endEval on a stepwise function, which is semi-convex as well :  0 till time 0, cost 1 in [0,time1), cost2 in [time1,time2), cost3 in [time2,time3) and cost4 from time3

    Is it allowed , and if yes, how shall I create this endEval expression from this stepwise function ?

    Thanks

    David


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: endEval on a stepwise function

    Posted 12/26/16 12:34 PM

    Hi,

    you can describe any stepwise as a piecewise.

    Let me give you an OPL example:

    stepFunction f=stepwise {0->1; 2-> 2; 3-> 6;10};

    pwlFunction f2=piecewise {0->1;2->1;0->2;1->2;0->6;7->6;0};

     

    assert f(0)==f2(0);
    assert f(1)==f2(1);
    assert f(2)==f2(2);
    assert f(6)==f2(6);

    regardds


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: endEval on a stepwise function

    Posted 12/30/16 06:02 AM

    Originally posted by: Paul Shaw


    Hi,

     

    For the Java API, you can look at the delivered example SchedTime.java, which uses IloCP.endEval with an IloNumToNumSegmentFunction created through a call to IloCP.piecewiseLinearFunction.  The documentation for the latter function explains how to repeat an x-value in the specification of the piecewise linear function to create a discontinuity.

     

    Regards,

     

    Paul


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: endEval on a stepwise function

    Posted 01/03/17 05:51 AM

    Originally posted by: DavidGravot


    Thanks Alex and Paul. 


    #CPOptimizer
    #DecisionOptimization