Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

DocPlex Optimization Hanging Infrequently

  • 1.  DocPlex Optimization Hanging Infrequently

    Posted Wed October 10, 2018 12:44 PM

    Originally posted by: JPRyan


    I'm running a fairly complicated but low variable number Piecewise-linear AdvModel with a quadratic term.  I need to run thousands of these quick optimizations.  Normally they take around 3 hundreths of a second, but very occasionally (~1/10000 optimizations) the solve call can take 20 minutes or even hang indefinitely churning away.  I know it is still the CPlex solver running as it is the only multi-threading program on the test computer and it is driving all four cores.

     

    I'd like to implement a time limit and when it times out check the inputs to see why this is happening.  I tried the below but it doesn't seem to stop CPlex from churning well beyond 20 seconds on these rare occasions.

     

    mdl = AdvModel()

    mdl.parameters.timelimit = 20  #Seconds I believe....

     

    I even tried implemented a quick decorator around the wrapping function to check that the AdvModel is running after beyond its time limit and I'm pretty sure it is.  Am I implementing the timelimit incorrectly?

      Ryan

      

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: DocPlex Optimization Hanging Infrequently

    Posted Thu October 11, 2018 06:31 AM

    To set parameters, you should not assign value but use the set() function:

    mdl.parameters.timelimit.set(20)

     


    #CPLEXOptimizers
    #DecisionOptimization