Decision Optimization

Decision Optimization

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

 View Only
  • 1.  How to use OPL script to change Cplex parameters inside the main block.

    Posted Wed May 18, 2011 05:10 AM

    Originally posted by: bindasmariner


    Dear all

    I am experimenting with a Column generation assignment in ILOG OPL. I want to terminate the sub-problem which is an MIP, when it reaches a certain MIP tolerance gap (say 10%). I tried following code in the body of the sub-problem in the pre-processing part, but it is not working.Although it works when I run the sub-problem separately.

    execute PARAM{
    cplex.epagap = 1;
    }

    Please suggest the workable way.

    Best Regards
    Saurabh
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to use OPL script to change Cplex parameters inside the main block.

    Posted Thu May 19, 2011 02:51 PM

    Originally posted by: harshvnit


    Are you loading and calling your sub-problem model file into the scripting code. If yes, then you should keep the 'cplex.epgap' statement in your subproblem model file. That should serve the purpose of solving the subproblem and stopping it with a 10% gap and giving you a best integer solution.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to use OPL script to change Cplex parameters inside the main block.

    Posted Thu May 19, 2011 03:15 PM

    Originally posted by: bindasmariner


    Thanks for the reply. This thing works the way you said. Although is it possible to change the CPLEX parameters from the main block for a model, rather than by writing within the MIP model itself?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to use OPL script to change Cplex parameters inside the main block.

    Posted Tue May 31, 2011 02:13 PM

    Originally posted by: SystemAdmin


    To set a CPLEX parameter by script (in a main block for example), you would use a statement like:
    cplex.theParam = theValue;
    


    In the documentation, check "IDE and OPL > Optimization Programming Language (OPL) > Parameters and Settings in OPL > Mathematical programming options > CPLEX parameters and OPL parameters" to get the list of parameters that cannot be set by scripting.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: How to use OPL script to change Cplex parameters inside the main block.

    Posted Fri June 03, 2011 09:25 PM

    Originally posted by: harshvnit


    If you have your sub problem defined like this, you can change the parameter by m2Cplex.epagap, m2Cplex.tilim etc.

    var m2Source = new IloOplModelSource("uPMSP_LowerBound3.mod");
      var m2Cplex = new IloCplex();
      var m2Def = new IloOplModelDefinition(m2Source);
       
     var m2_init = new IloOplModel(m2Def,m2Cplex);
      m2_init.addDataSource(data);
     
    m2.generate();
    m2Cplex.tilim=30;
    m2Cplex.solve();
    

    In this example it will start solving the uPMSP_LowerBound3.mod and stop after 30 seconds
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: How to use OPL script to change Cplex parameters inside the main block.

    Posted Mon March 11, 2013 11:04 PM

    Originally posted by: SystemAdmin


    Dear all,
    I have a problem to stop my OPL running after it gives the solution. the same model stops after finding the optimal but for the large size model although it finds the optimal and also gives the solution, it is still running.
    Any help or idea this kind of problem.
    Thanks, in advance.
    Erhan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer