Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Breakpoints for piecewise/stepwise

    Posted 04/12/12 09:48 AM

    Originally posted by: SystemAdmin


    Hi,

    it seems that there is a different interpretation of breakpoints for piecewise() and stepwise().
    Consider the following small model:
    
    dvar int+ x; dexpr 
    
    float obj_pwf =  piecewise
    { 0->10; 1 
    } (0, 0) x; dexpr 
    
    float obj_swf =  stepwise
    { 0->10; 10 
    } x;   dexpr 
    
    float obj = obj_pwf + obj_swf; minimize obj; subject to
    { x == 10; 
    }   execute
    { writeln(
    "     x = ", x); writeln(
    "    obj      = ", obj); writeln(
    "    obj_pwf  = ", obj_pwf); writeln(
    "    obj_swf  = ", obj_swf); 
    }
    

    which yields some strange output :
    
    
    // solution (optimal) with objective 0 x = 10 obj      = 10 obj_pwf  = 0 obj_swf  = 10
    


    First, OPL claims "solution (optimal) with objective 0" although we have "obj=10"
    (what changes to "solution (optimal) with objective 10" if we maximize instead)

    Moreover, what is the reason for handling the breakpoints differently? In case
    of pwf the "old slope" is applied whereas for swf the "new step" is applied?
    Quite confusing ...
    Best regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Breakpoints for piecewise/stepwise

    Posted 04/13/12 02:00 AM
    Hi,

    apart from the strange objective we get in the IDE (which should be equal to obj), this looks normal.

    dexpr float obj_pwf =  piecewise{ 0->10; 1 } (0, 0) x;
    dexpr float obj_swf =  stepwise{ 0->10; 10 } x;
    


    In obj_pwf, the slope is 0 til x=10 and then the slope becomes 1
    In obj_swf, the value is 0 before x=10, 10 excluded, and then the value becomes 10.

    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Breakpoints for piecewise/stepwise

    Posted 04/16/12 10:11 AM

    Originally posted by: SystemAdmin


    Alex,
    you are right.
    Thanks
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer