Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  dynamic model

    Posted 12/19/11 03:30 PM

    Originally posted by: yek_ti1


    Hi,

    instead of using static model doing
    model.add (test==1);
    solver.solve();

    I'm using something like:
    Ilcgoal goal (...){
    solver.add (test==1);
    retunr 0.
    }
    solver.solve(goal);

    My question is:
    is there a difference with the last sample and
    this one :
    IlcGoal goal(...){
    return (test==1);
    }
    solver.solve(goal);

    It seems to me that it should be equivalent but maybe i'm missing something important ?
    Thank you by advance.
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: dynamic model

    Posted 12/20/11 02:48 AM

    Originally posted by: SystemAdmin


    Hello.

    There's no real difference between the two versions. Note that
    
    
    
    return (test==1);
    

    creates a new goal for decision test==1. This goal is executed just after the current goal. Therefore in total, there will be two goals executed. A shortcut is:
    
    solver.solve(IlcGoal(test==1));
    

    This executes only one goal, but otherwise there's no difference.
    Note that your search should instantiate all variables, not only variable test.

    Best regards, Petr
    #CPOptimizer
    #DecisionOptimization