Get variables from expressions (cpmpy.transformations.get_variables)
Getting and printing variables in the model or expression.
Variables are ordered by appearance, e.g. first encountered first.
- cpmpy.transformations.get_variables.get_variables(expr, collect=None)[source]
Get variables of an expression
- Parameters:
expr – Expression or list of expressions
collect – optional set, variables will be added to this set of given
- cpmpy.transformations.get_variables.get_variables_model(model)[source]
Get variables of a model (constraints and objective)
This is a separate function because we can not import Model without a circular dependency…