(class from pyomo.core.expr.visitor)
pyomo.core.expr.visitor
Bases: IdentifyVariableVisitor
IdentifyVariableVisitor
Visitor that collects all unique variables participating in an expression
include_fixed (bool) – Whether to include fixed variables
named_expression_cache (optional, dict) – Dict mapping ids of named expressions to a tuple of the list of all variables and the set of all variable ids contained in the named expression.
Methods
__init__()
__init__
beforeChild(parent, child, index)
beforeChild
exitNode(node, data)
exitNode
finalizeResult(result)
finalizeResult
initializeWalker(expr)
initializeWalker
walk_expression(expr)
walk_expression
Walk an expression, calling registered callbacks.
walk_expression_nonrecursive(expr)
walk_expression_nonrecursive
Nonrecursively walk an expression, calling registered callbacks.
Attributes
client_methods
Member Documentation
This is the standard interface for running the visitor. It defaults to using an efficient recursive implementation of the visitor, falling back on walk_expression_nonrecursive() if the recursion stack gets too deep.
walk_expression_nonrecursive()
This routine is safer than the recursive walkers for deep (or unbalanced) trees. It is, however, slightly slower than the recursive implementations.