sasoptpy.Model.add_variables

Model.add_variables(self, *argv, name, vartype=None, lb=None, ub=None, init=None)[source]

Adds a group of variables to the model

Parameters
argvlist, dict, pandas.Index

Loop index for variable group

namestring

Name of the variables

vartypestring, optional

Type of variables, BIN, INT, or CONT

lblist, dict, pandas.Series

Lower bounds of variables

ublist, dict, pandas.Series

Upper bounds of variables

initlist, dict, pandas.Series

Initial values of variables

Examples

>>> production = m.add_variables(PERIODS, vartype=so.INT,
                                name='production', lb=min_production)
>>> print(production)
>>> print(repr(production))
Variable Group (production) [
  [Period1: production['Period1',]]
  [Period2: production['Period2',]]
  [Period3: production['Period3',]]
]
sasoptpy.VariableGroup(['Period1', 'Period2', 'Period3'],
name='production')