Types and Bounds
jijmodeling
supports integer IntegerVar
and continuous variables ContinuousVar
in addition to binary variables BinaryVar
as decision variables. Different from BinaryVar
, both IntegerVar
and ContinuousVar
requires lower and upper bounds:
# Integer variable in [0, 10]
x = jm.IntegerVar("x", lower_bound=0, upper_bound=10)
# Continuous variable in [0, 2.5]
y = jm.ContinuousVar("y", lower_bound=0.0, upper_bound=2.5)
There are also semi-integer and semi-continuous variable which takes value in its bound or :
# Integer value in [3, 10] or 0
sx = jm.SemiIntegerVar("x", lower_bound=3, upper_bound=10)
# Continuous value in [0.5, 2.0] or 0
sy = jm.SemiContinuousVar("y", lower_bound=0.5, upper_bound=2.0)
Bound of variables can be Placeholder
or scalar expression without decision variables.
L = jm.Placeholder("Lower")
U = jm.Placeholder("Upper")
x = jm.IntegerVar("x", lower_bound=L, upper_bound=U)
y = jm.ContinuousVar("y", lower_bound=L/2, upper_bound=U*U)
Encoding to binary variables
To be written.