suffix
(class from pyomo.core.kernel.suffix
)
- class pyomo.core.kernel.suffix.suffix(*args, **kwds)[source]
Bases:
ISuffix
A container for storing extraneous model data that can be imported to or exported from a solver.
Methods
__init__
(*args, **kwds)activate
()Activate this object.
clear
()DEPRECATED.
clear_value
(component)DEPRECATED.
clone
()Returns a copy of this object with the parent pointer set to
None
.Deactivate this object.
Returns
True
when this suffix is enabled for export to solvers.get
(k[,d])DEPRECATED.
DEPRECATED.
getname
([fully_qualified, name_buffer, ...])Dynamically generates a name for this object.
Returns
True
when this suffix is enabled for import from solutions.items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
set_all_values
(value)DEPRECATED.
set_datatype
(datatype)DEPRECATED.
set_direction
(direction)DEPRECATED.
setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()Attributes
EXPORT
FLOAT
IMPORT
IMPORT_EXPORT
INT
LOCAL
The active status of this object.
The object's category type.
Return the suffix datatype.
Return the suffix direction.
hasher
The object's local name within the context of its parent.
The object's fully qualified name.
The object's parent (possibly None).
The object's storage key within its parent
Member Documentation
- activate()
Activate this object.
- clear() None. Remove all items from D.
- clear_all_values()[source]
DEPRECATED.
Deprecated since version 5.3: suffix.clear_all_values is replaced with suffix.clear
- clear_value(component)[source]
DEPRECATED.
Deprecated since version 5.3: suffix.clear_value will be removed in the future. Use ‘del suffix[key]’ instead.
- 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.
- deactivate()
Deactivate this object.
- get(k[, d]) D[k] if k in D, else d. d defaults to None.
- get_datatype()[source]
DEPRECATED.
Deprecated since version 5.3: suffix.get_datatype is replaced with the property suffix.datatype
- get_direction()[source]
DEPRECATED.
Deprecated since version 5.3: suffix.get_direction is replaced with the property suffix.direction
- 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
.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(k[, d]) v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
- set_all_values(value)[source]
DEPRECATED.
Deprecated since version 5.3: suffix.set_all_values will be removed in the future.
- set_datatype(datatype)[source]
DEPRECATED.
Deprecated since version 5.3: suffix.set_datatype is replaced with the property setter suffix.datatype
- set_direction(direction)[source]
DEPRECATED.
Deprecated since version 5.3: suffix.set_direction is replaced with the property setter suffix.direction
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values
- property active
The active status of this object.
- property ctype
The object’s category type.
- property datatype
Return the suffix datatype.
- property direction
Return the suffix direction.
- 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