Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How can I define a 3D variable array as binary variable?

    Posted 07/22/10 08:30 AM

    Originally posted by: Ptktsang


    I make use of the method (version 1) provided by RodrigoLinfati in this page, http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14463933,to define a 3D variable array.

    However, I have no idea how to define the variable as binary. Please help me.

    Below are modified code but without the idea of defining binary variable for your reference.

    IloArray <IloArray <IloArray <IloNumVar> > > y (env, n1);
            for (int i=0; i<n1; i++) {
                y[i] = IloArray <IloArray<IloNumVar> > (env, n2);
                for (int j=0; j<n2; ++j) {
                    y[i][j] = IloArray <IloNumVar> (env, n3);
                    for (int k=0; k<n3; ++k) {
                        y[i][j][k] = IloNumVar(env);
                        cout << i << " " << j << " " << k << " " << y[i][j][k] << endl;
                    }
                }
            }
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How can I define a 3D variable array as binary variable?

    Posted 07/22/10 09:34 AM

    Originally posted by: SystemAdmin


    Change IloNumVar to IloBoolVar.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How can I define a 3D variable array as binary variable?

    Posted 07/24/10 01:48 PM

    Originally posted by: Ptktsang


    Thx Paul. It works. Thanks a lot. Could you also have a look my another post and help to solve this problem, https://www.ibm.com/developerworks/forums/thread.jspa?threadID=335431&tstart=0?
    #CPLEXOptimizers
    #DecisionOptimization