Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  OPL Script problems w/ printSolution(), solutionValue, and accessing tuple elements

    Posted 06/24/15 05:36 AM

    Originally posted by: ouaigooo


    Hello

    I have 3 problems w/ OPL script.

    PROBLEM #1 I cannot access a individual element of an float array within a tuple (see line 44 of master_simple.mod).

    PROBLEM #2 When resolving (after having changed obj coef), some 'solutionValue'-calls return results that are not updated (see line 35 of master_simple.mod)

    PROBLEM #3 And .printSolution() is not updated neither (see line 64 of master_simple.mod)

    Below is the scripting log.

    OPL version: 12.6.2 (and 12.5.1)

    Thanks in advance for your help !

     [-25.51 126.35]
    . set obj coef for power[D 487926000]: 25.51
    . set obj coef for power[D 487929600]: -72.54000000000001
    . set obj coef for power[D 487933200]: -78.79000000000001
    . set obj coef for power[D 487936800]: -40.53
    . set obj coef for power[D 487940400]: -14.49
     obj   : 255.1
     bound : -Infinity
    . power  [10 0 0 0 0]
     . power[D 487926000] 10
     . power[D 487929600] 0
     . power[D 487933200] 0
     . power[D 487936800] 0
     . power[D 487940400] 0
    // solution (optimal) with objective 255.1
    // Quality There are no bound infeasibilities.
    // There are no reduced-cost infeasibilities.
    // Maximum Ax-b  residual             = 0
    // Maximum c-B'pi residual            = 0
    // Maximum |x|                        = 10
    // Maximum |slack|                    = 10
    // Maximum |pi|                       = 25.51
    // Maximum |red-cost|                 = 104.3
    // Condition number of unscaled basis = 3.0e+000
    //

    power = [10
             0 0 0 0];

     [-25.51 126.35]
    . set obj coef for power[D 487926000]: -126.35
    . set obj coef for power[D 487929600]: -73.40000000000001
    . set obj coef for power[D 487933200]: -79.65000000000001
    . set obj coef for power[D 487936800]: -41.4
    . set obj coef for power[D 487940400]: -15.36
     obj   : 0
     bound : -Infinity
    . power  [10 0 0 0 0]
     . power[D 487926000] 0
     . power[D 487929600] 0
     . power[D 487933200] 0
     . power[D 487936800] 0
     . power[D 487940400] 0
    // solution (optimal) with objective 0
    // Quality There are no bound infeasibilities.
    // There are no reduced-cost infeasibilities.
    // Maximum Ax-b  residual             = 0
    // Maximum c-B'pi residual            = 0
    // Maximum |x|                        = 0
    // Maximum |slack|                    = 10
    // Maximum |pi|                       = 0
    // Maximum |red-cost|                 = 126.35
    // Condition number of unscaled basis = 1.0e+000
    //

    power = [10
             0 0 0 0];

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: OPL Script problems w/ printSolution(), solutionValue, and accessing tuple elements

    Posted 06/24/15 07:07 AM

    Hi

    Pb1 : I agree there seems to be an issue. A workaround could be to avoid using arrays as a field in the tuple set and replace with a tuple set with a field scenario

    Pb2&3: if after

    algo.solve();

    you add
        model.postProcess();

    it should work better

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: OPL Script problems w/ printSolution(), solutionValue, and accessing tuple elements

    Posted 06/24/15 09:29 AM

    Originally posted by: ouaigooo


    Thanks Alex.

    Pb2&3: In my particular case, postProcess() will do some other stuff. So I would actually prefer not to call it. Is it a necessary call ? What is really bizarre is that I can still get the right values when accessing individual array elements ...

    Pb1: cool suggestion, thanks. But like you say, it is a workaround. It is supposed to work the way I implemented it. I'd like to hear CPLEX's staff on this one, because I'm getting tired of workarounds all time ...

    Kind regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: OPL Script problems w/ printSolution(), solutionValue, and accessing tuple elements

    Posted 06/24/15 09:54 AM

    Hi,

    about pb2&3,

    let me quote documentation.

    postprocess:

    Used to perform postprocessing. After a solution is found, the postprocessing part of the model can be executed. The solving is controlled outside OPL, therefore this service routine has to be invoked manually whenever a new solution is available.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: OPL Script problems w/ printSolution(), solutionValue, and accessing tuple elements

    Posted 06/25/15 01:32 AM

    Originally posted by: ouaigooo


    Fair enough. A big thanks, Alex.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer