Variable functionality#
Add variable(s)#
|
Create and add a single variable to the DOcplex model. |
|
Create and add multiple variables (corresponding to an index-set) to the DOcplex model. |
VarDict1D#
Custom subclass of dict to store DOcplex model variables with 1-dim scalar keys.
This class is not meant to be instantiated; VarDict1D is built through the docplex_extensions.add_variables function. |
Attributes#
DOcplex model associated with the variables. |
|
DOcplex VarType corresponding to the variables. |
|
Name to refer to 1-dim scalar keys. |
|
Name to refer to Dict values. |
Numerical operations#
Sum all variables in a linear expression. |
Mapping operations#
|
Get the variable for the specified key, or the default if not found. |
|
Get the variable for the specified key, or zero if it is not found. |
Views#
VarDict1D.items()VarDict1D.keys()VarDict1D.values()
VarDictND#
Custom subclass of dict to store DOcplex model variables with N-dim tuple keys.
This class is not meant to be instantiated; VarDictND is built through the docplex_extensions.add_variables function. |
Attributes#
DOcplex model associated with the variables. |
|
DOcplex VarType corresponding to the variables. |
|
Names to refer to each dimension of N-dim tuple keys. |
|
Name to refer to Dict values. |
Numerical operations#
|
Sum all variables, or a subset based on wildcard pattern, in a linear expression. |
Mapping operations#
|
Get the variable for the specified key, or the default if not found. |
|
Get the variable for the specified key, or zero if it is not found. |
Efficient subset selection#
|
Get a subset of the N-dim tuple keys of the Dict with a wildcard pattern. |
|
Get Dict values for all keys that match the wildcard pattern. |
Views#
VarDictND.items()VarDictND.keys()VarDictND.values()