Decision Optimization

Decision Optimization

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

 View Only
  • 1.  opl configs in WML

    Posted Mon October 05, 2020 03:11 AM
    Hi there!!!

    Normally I used an execute block to give the settings to the opl model, but now I don´t know how to do the same in WML.

    Right now, I have a model that uses CP, but it iterates until time runs out without being able to rescue the solution. More over, I try to tell it not to process all the solutions it finds but it doesn't work for me.

    For example in the .mod file I use to write this:

    execute INIT {
    cp.param.TimeLimit = 180;
    settings.oaas_processFeasible = 0;
    }


    And now using de WML API REST I try this in my jobs:
      "decision_optimization": {
        "solve_parameters": {
          "oaas.includeInputData": "false",
          "oaas.logAttachmentName": "log.txt",
          "oaas.logTailEnabled": "true",
          "oaas.resultsFormat": "XLSX",
    "oaas.processFeasible": "0", "oaas.timeLimit": "180000" },
    but it doesn't work :(




    ------------------------------
    Jorge Rojas Pizarro
    ------------------------------

    #DecisionOptimization


  • 2.  RE: opl configs in WML

    Posted Mon October 05, 2020 04:21 AM
    Hi,

    in CPLEX IDE I ran in WML



    using CP;

    execute INIT {
    cp.param.TimeLimit = 180;
    settings.oaas_processFeasible = 1;

    }

    dvar int x;
    subject to
    {
    x==2;
    }

    execute
    {
    writeln("settings.oaas_processFeasible=",settings.oaas_processFeasible);

    }



    which gives in the log

    [2020-10-05T08:14:41Z, INFO] settings.oaas_processFeasible=true
    [2020-10-05T08:14:41Z, INFO] Total time spent in post processing: 1 msecs.
    [2020-10-05T08:14:41Z, INFO] Solve finished with status: FEASIBLE_SOLUTION.


    And you can also use oplrunwml to do the same with command line

    regards

    ------------------------------
    ALEX FLEISCHER
    ------------------------------



  • 3.  RE: opl configs in WML

    Posted Tue October 06, 2020 09:07 AM
    Hi Jorge,

    as Alex exaplined you should continue to put settings in the beginning of the OPl file.

    But we have some issue with 
    execute {
    settings.oaas_processFeasible = 0;
    }

    which is not fully taken into accoutn in WML.
    This is being fixed.
    The impact currently is that while not all postprocessing is done on each intermediate solution, some time is spent which shoudl not.
    As said, we are fixing this.

    Thanks
    Alain

    ------------------------------
    Alain Chabrier
    ------------------------------



  • 4.  RE: opl configs in WML

    Posted Wed October 07, 2020 07:47 AM
    Thank you very much to both of you for answering me.

    I will consider this extra time on the jobs I'm running then.

    Taking the opportunity :D

    If I use staticlex to solve multiobjective problems, it seems that WML is not considering the TimeLimit, but trying to solve until it finds the optimal solution. 

    An example, the start of the job:

    [2020-10-07T01:02:23Z, INFO] ! -------------------------------------------------- CP Optimizer 12.10.0.0 --
    [2020-10-07T01:02:23Z, INFO] ! Maximization problem - 4,818 variables, 22,833 constraints
    [2020-10-07T01:02:23Z, INFO] ! Presolve : 8,758 extractables eliminated
    [2020-10-07T01:02:23Z, INFO] ! TimeLimit = 300
    [2020-10-07T01:02:23Z, INFO] ! Workers = 1
    [2020-10-07T01:02:23Z, INFO] ! Initial process time : 1.41s (1.41s extraction + 0.00s propagation)
    [2020-10-07T01:02:23Z, INFO] ! . Log search space : 10,389.8 (before), 10,389.8 (after)
    [2020-10-07T01:02:23Z, INFO] ! . Memory usage : 13.9 MB (before), 13.9 MB (after)
    [2020-10-07T01:02:23Z, INFO] ! Using sequential search.
    [2020-10-07T01:02:23Z, INFO] ! ----------------------------------------------------------------------------

    36 minutes later :

    [2020-10-07T01:38:23Z, INFO] 1832.500 2,608k 3 F !presenceOf(_itv1,965)
    [2020-10-07T01:38:23Z, INFO] * 1832.500 2,608k 131.21s (gap is 0.64% @ crit. 1 of 4)
    [2020-10-07T01:38:23Z, INFO] New objective is 1832.500; -7,994; 0; 2.675705e+12

    then I cancel the job

    Am I doing something wrong? It works perfectly before WML.

    Thanks for your support.

     


    ------------------------------
    Jorge Rojas Pizarro
    ------------------------------



  • 5.  RE: opl configs in WML

    Posted Wed October 07, 2020 11:24 AM
    Hi,
    can you share the model and data so that other users could try ?
    regards

    ------------------------------
    ALEX FLEISCHER
    ------------------------------