Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

when we are using ilo?

  • 1.  when we are using ilo?

    Posted Sun March 13, 2016 09:58 PM

    Originally posted by: FiFila


    Hi;

    Would you please let me know when we are using "ilo" in modeling for instance iloconstraint,... ! Why some of them are written as "constraint"?

    Thanks


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: when we are using ilo?

    Posted Tue March 15, 2016 11:26 AM

    Originally posted by: rdumeur


    Dear FIFIla,

     

    Ilo prefixed object types are modeling ones. Thus you will use IloIntVar when you want to create an integer variable in your model. For instance, the following snippets

    create an "all different" constraint on an array of variables "x". It uses "Ilo" data types "IloIntVarArray" and "IloAllDiff" to create variables and constraints respectively.

     

    #include <ilcp/cp.h>
    
    int main() {
      IloEnv                env;
      IloIntVarArray        x(env, 10, 0, 9);
      IloModel              m(env);
      m.add(IloAllDiff(env, x));
      IloCP                 cp(m);
      
      cp.solve();
      for(IloInt i = 0; i < 10; ++i)
        std::cout << "x[" << i << "] = " << cp.getValue(x[i]) << std::endl;
      cp.end();
      env.end();
      return 0;
    }
    

     

    I hope this helps.

    Cheers,

     


    #CPOptimizer
    #DecisionOptimization