Decision variables
declarations x, b, d: mpvar ifmake: array(1..10, 1..20) of mpvar y, z: array(1..10) of mpvar end-declarations
mpvar means mathematical programming variable or decision variable, sometimes also just called variable. Decision variables are unknowns: they have no value until the model is run, and the optimizer finds values for the decision variables.
Variables can take values between 0 and infinity by default, other bounds may be specified:
x <= 10 y(1) = 25.5 y(2) is_free z(2,3) >= -50 z(2,3) <= 50
Integer programming types are defined as unary constraints on previously declared decision variables
b is_binary ! Single binary variable forall(p in PRODS,l in LINES) ifmake(p,l) is_binary ! An array of binaries d is_integer ! An integer variable d <= 25 ! Upper bound on the variable x is_partint 10 ! Partial integer (integers up to 10, continuous beyond) y(3) is_semcont 5 ! Semi-continuous (0 or greater or equal 5)