Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to modifiy the model dynamicly

    Posted 10/24/10 09:39 AM

    Originally posted by: RainLee


    Hi,all
    I want to make a model which include two class constraints,one is solid,it is the same in every iteration,the remaining constraints is changed in iteration. My question is:
    1.how to identify and delete the changed constraints?
    2.how to add the new constraints in a structued model in iteration?

    wishes for your help,thanks in advance!
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: how to modifiy the model dynamicly

    Posted 10/25/10 12:46 PM

    Originally posted by: SystemAdmin


    What API are you using? Doing what you want is rather easy but depends on the API being used.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: how to modifiy the model dynamicly

    Posted 10/25/10 09:35 PM

    Originally posted by: RainLee


    I use concert technology for c++ users, wish for your help.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: how to modifiy the model dynamicly

    Posted 10/26/10 03:12 AM

    Originally posted by: SystemAdmin


    Use IloModel::add() and IloModel::remove():
    
    IloEnv env; IloModel model(env);   
    // add the permanent constraints model.add(IloRange(env, ...)); ...   
    // Create instance of IloCplex that solves model. IloCplex cplex(model);   
    // Now loop and use additional temporary constraints in each loop. 
    
    for (
    
    int i = 0; i < ???; ++i) 
    { 
    // Create an array of temporary constraints. IloExtractableArray temporary(env); temporary.add(IloRange(env, ...)); 
    // Create one temporary constraint temporary.add(IloRange(env, ...)); 
    // Create another temporary constraint   
    // Add temporary constraints to model. This will notify the IloCplex instance about the new constraints. model.add(temporary);   
    // Solve the problem. cplex.solve();   
    // Handle solution. ...   
    // Remove temporary constraints (will notify IloCplex instance) and delete them. model.remove(temporary); temporary.endElements(); temporary.end(); 
    }
    

    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: how to modifiy the model dynamicly

    Posted 10/26/10 04:44 AM

    Originally posted by: RainLee


    Daniel Junglas,
    thanks a lot for your help,that's just the answer.
    #DecisionOptimization
    #MathematicalProgramming-General