Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  solving OR problem in phases

    Posted 11/25/08 06:46 PM

    Originally posted by: SystemAdmin


    [vmehend said:]

    Hi,

    i am solving my problem in phases. what method should i call to get rid of constraints and variables at the end of a phase run ? is cplex.clearModel() one of the choices ?

    thanks,
    Vinay

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: solving OR problem in phases

    Posted 11/25/08 07:33 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    If you want to get rid of [i]all[/i] variables and [i]all[/i] constraints, clearModel will work.  If you want to get rid of just selected variables and constraints, assign them to variables (I mean here ordinary programming variables, not IloNumVar type variables) and invoke the remove method on them.  For instance,

    IloCplex cplex;
    // add some stuff
    IloRange phase1Only = new IloRange[3];
    for (int n = 0; n < 3; n++ ) {<br />  phase1Only[n] = ...;  // add a constraint targeted for phase 1 only
    }
    // finish model
    cplex.solve();  // solve and do something with result
    cplex.remove(phase1Only);  // drop the phase 1 only constraints
    // ...
    #CPLEXOptimizers
    #DecisionOptimization