ICategorizedObjectContainer

(class from pyomo.core.kernel.base)

class pyomo.core.kernel.base.ICategorizedObjectContainer[source]

Bases: ICategorizedObject

Interface for categorized containers of categorized objects.

__init__()

Methods

__init__()

activate([shallow])

Activate this container.

child(*args, **kwds)

Returns a child of this container given a storage key.

children(*args, **kwds)

A generator over the children of this container.

clone()

Returns a copy of this object with the parent pointer set to None.

components(*args, **kwds)

A generator over the set of components stored under this container.

deactivate([shallow])

Deactivate this container.

getname([fully_qualified, name_buffer, ...])

Dynamically generates a name for this object.

Attributes

active

The active status of this object.

ctype

The object's category type.

local_name

The object's local name within the context of its parent.

name

The object's fully qualified name.

parent

The object's parent (possibly None).

storage_key

The object's storage key within its parent

Member Documentation

activate(shallow=True)[source]

Activate this container.

child(*args, **kwds)[source]

Returns a child of this container given a storage key.

children(*args, **kwds)[source]

A generator over the children of this container.

clone()

Returns a copy of this object with the parent pointer set to None.

A clone is almost equivalent to deepcopy except that any categorized objects encountered that are not descendents of this object will reference the same object on the clone.

components(*args, **kwds)[source]

A generator over the set of components stored under this container.

deactivate(shallow=True)[source]

Deactivate this container.

getname(fully_qualified=False, name_buffer={}, convert=<class 'str'>, relative_to=None)

Dynamically generates a name for this object.

Parameters:
  • fully_qualified (bool) – Generate a full name by iterating through all ancestor containers. Default is False.

  • convert (function) – A function that converts a storage key into a string representation. Default is the built-in function str.

  • relative_to (object) – When generating a fully qualified name, generate the name relative to this block.

Returns:

If a parent exists, this method returns a string representing the name of the object in the context of its parent; otherwise (if no parent exists), this method returns None.

property active

The active status of this object.

property ctype

The object’s category type.

property local_name

The object’s local name within the context of its parent. Alias for obj.getname(fully_qualified=False).

property name

The object’s fully qualified name. Alias for obj.getname(fully_qualified=True).

property parent

The object’s parent (possibly None).

property storage_key

The object’s storage key within its parent