Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

CP Optimizer maximum runtime

  • 1.  CP Optimizer maximum runtime

    Posted Fri February 08, 2019 03:24 AM

    Originally posted by: Viktoria_Austria


    Dear community,

     

    I know that it is possible to limit an optimization run by "cp.param.timelimit=x" in the main() area or to insert the wished limit directly in the settings (.ops) file. However, if I code a script, where multiple runs are performed automatically (e.g.  using a staticLex(() objective and optimizing the model multiple times in a row with differing input by using main()), is there also a possiblity to limit the CP Optimizer with an overall allowed running time? (I want the CP Optimizer to optimize every single run as long as it needs but I want to stop the overall process after e.g. 1 hour)

     

    Thank you very much for your help.

     

    Best,

    Viktoria


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: CP Optimizer maximum runtime

    Posted Fri February 08, 2019 07:34 AM

    Hi

    what you can do is have a global time limit in the main scripting block and then after each solve you decrease that value and you give that new value as a hard stop for next solve.

    To get the time that was used have a look at

    cp.info.TotalTime
    

    regards

    https://www.linkedin.com/pulse/how-opl-alex-fleischer/


    #CPOptimizer
    #DecisionOptimization