Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Defining Three dimensional Decision variable

    Posted Fri June 01, 2018 12:55 PM

    Originally posted by: Ehsan H.


    I am using C# CPLEX concert tech. I want to define a Three dimensional Decision variable such as W[i][j][k] as follow:

     

    INumVar[][][] W = new INumVar[numberOfAllNode][][];

                for (int i = 0; i < numberOfAllNode; i++) 
                {
                   
                  for (int j = 0; j < numberOfAllNode; j++)
                  {

                          W[i][j] = cplex.NumVarArray(numberOfAllNode, 0, 1);

                  }
                }

     

    after executing the code it gives the error:  NullReferenceException in W[i][j] = cplex.NumVarArray(numberOfAllNode, 0, 1); 

     

    Is there any method to create or modify this semi-code? 

    Thank you in advance for your replies. 

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Defining Three dimensional Decision variable