Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 12/24/11 08:28 PM

    Originally posted by: PingLiu


    For example, the command set mip limits nodes 1 in the Interactive Optimizer corresponds to
    cplex.Param.mip.limits.nodes.Cur = 1;
    

    if I know the command write enr.sol in the Interactive Optimizer,
    what should the corresponding command in CPLEX Class API be?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 12/27/11 07:28 PM

    Originally posted by: SystemAdmin


    > if I know the command write enr.sol in the Interactive Optimizer,
    > what should the corresponding command in CPLEX Class API be?

    I was not able to find a direct equivalent of 'write enr.sol' in MATLAB. You could instead write out a MST file (similar to SOL file, but only stores the values of the integer variables of the model and not the continuous ones) by the following command:

    cplex.writeMipStart('enr.mst');
    


    The other option is to set the intsolfileprefix parameter from its default value of '' to some name 'enr'. This will then direct the solver to write out the solution file (of the form 'enr-XXXXX.sol', XXXXX denoting the sequence of the solution) every time it finds a new solution to the model. This is available in CPLEX Optimization Studio 12.3 and later:

    cplex.Param.output.intsolfileprefix.Cur='enr';
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/03/12 04:34 PM

    Originally posted by: PingLiu


    after I run the code
    cplex.writeMipStart('enr.mst');
    

    the error is
    ??? Error using ==> cplexlink122
    CPLEX Error  3020: No MIP start exists.
     
     
    Error in ==> C:\MATLAB\R2010b\toolbox\cplex\@Cplex\Cplex.p>Cplex.writeMipStart at 614
             %          iteration limit. A conflict is available, but
     
    Error in ==> C:\MATLAB\R2010b\toolbox\cplex\@Cplex\Cplex.p>Cplex.subsref at 2407
    


    after I run the code
    cplex.Param.output.intsolfileprefix.Cur='enr';
    

    the error is
    ??? Reference to non-existent field 'output'.
     
    Error in ==> C:\MATLAB\R2010b\toolbox\cplex\@Cplex\Cplex.p>Cplex.subsasgn at 2645
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/04/12 03:03 AM

    Originally posted by: John Cui


    Which version CPLEX are you using? And before you run writeMipStart, did you run cplex.solve first?

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/04/12 05:08 PM

    Originally posted by: PingLiu


    I'm using cplex 12.3 version.
    I can write the .mst file after running the cplex.solve right now.

    but when I run
    cpx.Param.output.intsolfileprefix.Cur='mipex2';
    


    ??? Reference to non-existent field 'output'.

    Error in ==> C:\MATLAB\R2010b\toolbox\cplex\@Cplex\Cplex.p>Cplex.subsasgn at 2645

    I cannot find the field cpx.Param.output in the cpx class,why?
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/04/12 06:46 PM

    Originally posted by: SystemAdmin


    > I'm using cplex 12.3 version.
    > I can write the .mst file after running the cplex.solve right now.

    Ok. So, the mst issue is resolved by making sure that you call the writeMipStart function after the solve function call.

    > cpx.Param.output.intsolfileprefix.Cur='mipex2';

    Is 'cpx' the name of the Cplex object in question? Also, do you call 'cpx=Cplex();' before this call? Can you make sure that you are referring to the correct CPLEX files before these calls (via the addpath function- addpath('<CPLEX_Studio123>\cplex\matlab\<win_port_name>');) since this parameter is available only in CPLEX Optimization Studio 12.3 and later versions?
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/04/12 07:37 PM

    Originally posted by: John Cui


    You can use below code to check you are really using 12.3:
    cplex=Cplex()
    cplex.getVersion()
    


    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/05/12 10:44 PM

    Originally posted by: PingLiu


    thank you for your suggestion.
    I thought I was using cplex 12.3, but it's cplex 12.2.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: command in CPLEX Class API corresponding to that in Interactive Optimizer

    Posted 01/05/12 10:44 PM

    Originally posted by: PingLiu


    thank you very much, it's ok now.
    the error is due to that I was using cplex 12.2 version.
    #CPLEXOptimizers
    #DecisionOptimization