'Is there a way to initialise a binary variable in C# using CPLEX ILOG Concert

A newbie to the the whole CPLEX ILOG Concert API user here who is trying to figure out how to implement this into a C# code.

I have tried to instantiate a variable as this:

INumExpr[,] x = new INumExpr[vVehicles.Length,rCustomerNodes.Length] ;

INumExpr[,,] y = new INumExpr[vVehicles.Length, rCustomerNodes.Length, rCustomerNodes.Length];

As a way to initialise the decision variables as such, but I also want to make the INumExpr as a boolean array and I dont know how to do that?

Please help .. Thanks :)



Solution 1:[1]

INumVar[] open = cplex.BoolVarArray(nbLocations);

In the example Facility.cs in CPLEX_Studio221\cplex\examples\src\cs

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex Fleischer