Originally posted by: peeyushBHU
Hi i have defined an array of bool variable in my optimization model as shown in the following code. The model consists an objective function and some constraints. When i solve the model it gives the value of Boolean variable (Emp[i].S[d][a] ) in double format (For Example:- 4.44089209850063E-16). I want it in the form of zero (0) or one (1) only for the further calculation in the model. Please suggest how do i solve this problem. I dont want floating point numbers, i only want values in 0 or 1 format that tha variable is defined for.
internal class EmployeeInfo
{
internal INumVar[][] S;
}
public static void Main(string[] args)
{
Cplex cplex = new Cplex();
EmployeeInfo[] Emp = new EmployeeInfo[50];
for (int i = 0; i < Emp.Length; i++)
{
Emp[i] = new EmployeeInfo();
Emp[i].S = new INumVar[Days][];
for (int d = 0; d < Days; d++)
{
Emp[i].S[d] = cplex.BoolVarArray(45);
}
}
}
#CPLEXOptimizers#DecisionOptimization