heterogeneous_containers

(function from pyomo.core.kernel.heterogeneous_container)

pyomo.core.kernel.heterogeneous_container.heterogeneous_containers(node, ctype=<class 'pyomo.core.kernel.base._no_ctype'>, active=True, descend_into=True)[source]

A generator that yields all heterogeneous containers included in an object storage tree, including the root object. Heterogeneous containers are categorized objects with a category type different from their children.

Parameters:
  • node – The root object.

  • ctype – Indicates the category of objects to include. The default value indicates that all categories should be included.

  • 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.

  • descend_into (bool, function) – Indicates whether or not to descend into a heterogeneous container. Default is True, which is equivalent to lambda x: True, meaning all heterogeneous containers will be descended into.

Returns:

iterator of heterogeneous containers in the storage tree, include the root object.