Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Parameter reinitialization

    Posted 01/07/14 10:05 AM

    Originally posted by: Zacharie_ALES


    Hello,

    To avoid memory leaks, I only use one cplex object that I reinitialize via the clearModel() and clearCallback() methods each time I want to solve a new problem.

    However the parameters of the cplex object do not seem to be reinitialized. Do you know if it's possible to set all the parameters to their default value ?

    I tried to use IloCplex.getParameterSet(), but it does not seem to work. Indeed, the following code throw an exception at the third line : "Parameter not  in ParameterSet" :      

    IloCplex c = new IloCplex();
    ParameterSet s = c.getParameterSet();
    System.out.println(s.getParam(IloCplex.DoubleParam.TiLim));
    

    Thanks in advance.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Parameter reinitialization

    Posted 01/07/14 04:35 PM

    This is the Java API? IloCplex.setDefaults() should reset all parameters to default values. It's not necessary, though. Parameters are essentially fields of an IloCplex instance, so when you create c (line 1 of your code) it is "born" with all default values. The reason for the exception is that (AFAIK) the ParameterSet s only contains non-default parameter values; so in this case it is empty, and thus getParam() in line 3 does not find TiLim (and will not find any other parameter). Invoking getParam() on c, rather than on s, should cough up a value for the time limit, and it should be the default value.

    Paul

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Parameter reinitialization

    Posted 01/10/14 04:38 AM

    Originally posted by: Zacharie_ALES


    Yes this is the java API. Indeed IloCplex.setDefaults() works just fine. 

    I thought the IloCplex.getParameterSet() function was returning all the parameters not only the modified ones. 

    Thanks.


    #CPLEXOptimizers
    #DecisionOptimization