Homogeneous Object Containers

class pyomo.core.kernel.homogeneous_container.IHomogeneousContainer[source]

Bases: pyomo.core.kernel.base.ICategorizedObjectContainer

A partial implementation of the ICategorizedObjectContainer interface for implementations that store a single category of objects and that uses the same category as the objects it stores.

Complete implementations need to set the _ctype attribute and declare the remaining required abstract properties of the ICategorizedObjectContainer base class.

Note that this implementation allows nested storage of other ICategorizedObjectContainer implementations that are defined with the same ctype.

components(active=True)[source]

Generates an efficient traversal of all components stored under this container. Components are categorized objects that are either (1) not containers, or (2) are heterogeneous containers.

Parameters:active (True/None) – Controls whether or not to filter the iteration to include only the active part of the storage tree. The default is True. Setting this keyword to None causes the active status of objects to be ignored.
Returns:iterator of components in the storage tree