get_vars_from_components
(function from pyomo.util.vars_from_expressions
)
- pyomo.util.vars_from_expressions.get_vars_from_components(block, ctype, include_fixed=True, active=None, sort=False, descend_into=<class 'pyomo.core.base.block.Block'>, descent_order=None)[source]
Returns a generator of all the Var objects which are used in Constraint expressions on the block. By default, this recurses into sub-blocks.
- Parameters:
ctype – The type of component from which to get Vars, assumed to have an expr attribute.
include_fixed – Whether or not to include fixed variables
active – Whether to find Vars that appear in Constraints accessible via the active tree
sort – sort method for iterating through Constraint objects
descend_into – Ctypes to descend into when finding Constraints
descent_order – Traversal strategy for finding the objects of type ctype