Integer decision variables
Integer decision variables represent unknown information in a problem.
Integer decision variables represent unknown information in a problem and differ from normal programming variables in that they have domains of possible values and may have constraints placed on the allowed combinations of theses values.
These decision variables are defined by the lower bound and upper bound for the variable. In the C++ API, the following constructor creates a constrained integer variable with bounds -1 and 10:
IloIntVar myIntVar(env, -1, 10);
In the Java™ API,
you create a constrained integer variable with bounds -1 and 10 with
the method IloCP.intVar:
IloIntVar myIntVar = cp.intVar(-1, 10);
In the C# API, you create a constrained
integer variable with bounds -1 and 10 with the method CP.IntVar:
IIntVar myIntVar = cp.IntVar(-1, 10);
In any solution, the value assigned by the optimizer to an integer decision variable must be between the lower and upper bounds, inclusive, of that variable. During the modeling stage, you may also modify the lower and upper bounds of a variable.
In the C++ API of CP Optimizer, the class IloIntVar represents integer decision variables.
In the Java API of
CP Optimizer, the interface IloIntVar represents
integer decision variables.
In the C# API of CP Optimizer, the interface IIntVar represents integer decision variables.
Integer decision variable
Integer decision variables represent unknown information in a problem.
Typically, the possible values are represented as a domain of integers with an upper bound and a lower bound. These variables are said to be constrained because constraints can be placed on them.
An interval variable can be specified as being optional, meaning that the interval can be absent from the solution schedule