Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Is it efficient?

    Posted 05/16/09 04:38 AM

    Originally posted by: SystemAdmin


    [stefan_s said:]

        261         IloModel model(env);
        262         populate_problem(data1, model, true, true, true);                                                     
        263         solve_problem(model);                                                                                 
        264         IloModel model1(env);
        265         populate_problem(data1, model1, false, true, true);                                                   
        266         solve_problem(model1);

    Every time I need to solve a problem, I'm creating a completely new model... maybe there is a way to destroy data in the previous model, and just repopulate it?

    Thank you

    PS. using concert, c++
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Is it efficient?

    Posted 05/16/09 05:43 AM

    Originally posted by: SystemAdmin


    [prubin said:]

    If a variable is carried over from one model to the next with changes to its bounds, you can just invoke the setBounds method to make the changes.  If a constraint is carried over with changes to its bounds, the same holds.  If you are changing one or two coefficients in a constraint (or the objective function), there are methods you can use for that (such as IloRange::setLinearCoefs).  For wholesale changes to a constraint or objective, the corresponding setExpr method may be easier (just redo the whole expression).  Finally, to get rid of a variable or constraint that has outlived its usefulness, you can invoke the end() method on it.  All these methods communicate the changes to the owning model automatically.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Is it efficient?

    Posted 05/18/09 12:25 PM

    Originally posted by: SystemAdmin


    [stefan_s said:]

    Thanks Paul, it is much clearer to me now.
    In my specific case I decided not to change anything because at any given time I don't know exactly which constraints and variables are in the model, so its hard to write the code to remove and add the correct ones.

    Thank again,
    Stefan
    #CPLEXOptimizers
    #DecisionOptimization