VariableAggregator
(class from pyomo.contrib.preprocessing.plugins.var_aggregator
)
- class pyomo.contrib.preprocessing.plugins.var_aggregator.VariableAggregator(**kwds)[source]
Bases:
IsomorphicTransformation
Aggregate model variables that are linked by equality constraints.
Before:
\[\begin{split}x &= y \\ a &= 2x + 6y + 7 \\ b &= 5y + 6 \\\end{split}\]After:
\[\begin{split}z &= x = y \\ a &= 8z + 7 \\ b &= 5z + 6\end{split}\]Warning
TODO: unclear what happens to “capital-E” Expressions at this point in time.
- __init__(**kwds)
Methods
__init__
(**kwds)apply
(model, **kwds)DEPRECATED.
apply_to
(model, **kwds)Apply the transformation to the given model.
create_using
(model, **kwds)Create a new model with this transformation
update_variables
(model)Update the values of the variables that were replaced by aggregates.
Member Documentation
- apply(model, **kwds)
DEPRECATED.
Deprecated since version 4.3.11323: Transformation.apply() has been deprecated. Please use either Transformation.apply_to() for in-place transformations or Transformation.create_using() for transformations that create a new, independent transformed model instance.
- apply_to(model, **kwds)
Apply the transformation to the given model.
- create_using(model, **kwds)
Create a new model with this transformation