DeclareGlobalSet
(function from pyomo.core.base.set
)
- pyomo.core.base.set.DeclareGlobalSet(obj, caller_globals=None)[source]
Declare a copy of a set as a global set in the calling module
This takes a Set object and declares a duplicate of it as a GlobalSet object in the global namespace of the caller’s module using the local name of the passed set. GlobalSet objects are pseudo-singletons, in that copy.deepcopy (and Model.clone()) will not duplcicate them, and when you pickle and restore objects containing GlobalSets will still refer to the same object. The declared GlobalSet object will be an instance of the original Set type.