SetInitializer

(class from pyomo.core.base.set)

class pyomo.core.base.set.SetInitializer(init, allow_generators=True)[source]

Bases: InitializerBase

An Initializer wrapper for returning Set objects

This initializer wraps another Initializer and converts the return value to a proper Pyomo Set. If the initializer is None, then Any is returned. This initializer can be ‘intersected’ with another initializer to return the SetIntersect of the Sets returned by the initializers.

__init__(init, allow_generators=True)[source]

Methods

__init__(init[, allow_generators])

constant()

Return True if this initializer is constant across all indices

contains_indices()

Return True if this initializer contains embedded indices

indices()

Return a generator over the embedded indices

intersect(other)

setdefault(val)

Attributes

verified

Member Documentation

constant()[source]

Return True if this initializer is constant across all indices

contains_indices()[source]

Return True if this initializer contains embedded indices

indices()[source]

Return a generator over the embedded indices

This will raise a RuntimeError if this initializer does not contain embedded indices