Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to break out while loop when computing time exceed sometime?

    Posted 03/01/12 03:49 AM

    Originally posted by: qtbgo


    Hi, in the following code, in the while loop, I want to break out when computing time exceed 3600s, how to do it?

    thanks

    
    
    /********************************************* * OPL 12.4 Model * Author: qtb * Creation Date: 2012-3-1 at 上午10:48:03 *********************************************/ using CP;   main 
    { ...... opl.generate(); cp.startNewSearch(); 
    
    while(cp.next() ) 
    { writeln(
    "obj = ", cp.getObjValue(),  
    " | time = ", cp.info.SolveTime); 
    // if(cp.info.SolveTime > 3600) break; 
    } cp.endSearch(); opl.end(); 
    }
    

    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: how to break out while loop when computing time exceed sometime?

    Posted 03/01/12 11:13 AM

    Originally posted by: ChrisBr


    Hello,

    Try to set
    
    cp.param.timeLimit = 3600;
    

    before
    
    cp.startNewSearch(); 
    
    while(cp.next())
    


    I hope this helps,

    Chris.

    PS: if your question concerns the OPL use of CP Optimizer, it might be better to post it in the OPL using CP Optimizer forum's part.
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: how to break out while loop when computing time exceed sometime?

    Posted 03/01/12 07:54 PM

    Originally posted by: qtbgo


    Thank you, and my apology.

    Could you move this post to OPL section?
    #CPOptimizer
    #DecisionOptimization