Component
(class from pyomo.core.base.component
)
- class pyomo.core.base.component.Component(**kwds)[source]
Bases:
ComponentBase
This is the base class for all Pyomo modeling components.
- Parameters:
Methods
__init__
(**kwds)clear_suffix_value
(suffix_or_name[, expand])Clear the suffix value for this component data
cname
(*args, **kwds)DEPRECATED.
construct
([data])API definition for constructing components
display
([ostream, verbose, prefix])get_suffix_value
(suffix_or_name[, default])Get the suffix value for this component data
getname
([fully_qualified, name_buffer, ...])Returns the component name associated with this object.
Return True if this class is a Pyomo component
Return True if this class has been constructed
is_expression_type
([expression_system])Return True if this numeric value is an expression
Return true if this component is indexed
Return True if this class is a Pyomo Boolean object.
Return True if this numeric value is a named expression
Return True if this class is a Pyomo numeric object
Return False unless this class is a parameter object
Return True if this object is a reference.
Return False unless this class is a variable object
model
()Returns the model associated with this object.
Returns the parent of this object.
Returns the component associated with this object.
pprint
([ostream, verbose, prefix])Print component information
reconstruct
([data])REMOVED: reconstruct() was removed in Pyomo 6.0.
Return self.model()
set_suffix_value
(suffix_or_name, value[, expand])Set the suffix value for this component data
type
()DEPRECATED.
Return True if this can be used as a model component.
Attributes
Return the active attribute
Return the class type for this component
Get the component name only within the context of the immediate parent container.
Get the fully qualified component name.
Member Documentation
- clear_suffix_value(suffix_or_name, expand=True)[source]
Clear the suffix value for this component data
- cname(*args, **kwds)
DEPRECATED.
Deprecated since version 5.0: The cname() method has been renamed to getname(). The preferred method of obtaining a component name is to use the .name property, which returns the fully qualified component name. The .local_name property will return the component name only within the context of the immediate parent container.
- get_suffix_value(suffix_or_name, default=None)[source]
Get the suffix value for this component data
- getname(fully_qualified=False, name_buffer=None, relative_to=None)[source]
Returns the component name associated with this object.
- is_component_type()
Return True if this class is a Pyomo component
- is_expression_type(expression_system=None)
Return True if this numeric value is an expression
- is_logical_type()
Return True if this class is a Pyomo Boolean object.
Boolean objects include constants, variables, or logical expressions.
- is_named_expression_type()
Return True if this numeric value is a named expression
- is_numeric_type()
Return True if this class is a Pyomo numeric object
- is_parameter_type()
Return False unless this class is a parameter object
- is_reference()
Return True if this object is a reference.
- is_variable_type()
Return False unless this class is a variable object
- reconstruct(data=None)[source]
REMOVED: reconstruct() was removed in Pyomo 6.0.
Re-constructing model components was fragile and did not correctly update instances of the component used in other components or contexts (this was particularly problemmatic for Var, Param, and Set). Users who wish to reproduce the old behavior of reconstruct(), are comfortable manipulating non-public interfaces, and who take the time to verify that the correct thing happens to their model can approximate the old behavior of reconstruct with:
component.clear() component._constructed = False component.construct()
- set_suffix_value(suffix_or_name, value, expand=True)[source]
Set the suffix value for this component data
- type()[source]
DEPRECATED.
Return the class type for this component
Deprecated since version 5.7: Component.type() method has been replaced by the .ctype property.
- property active
Return the active attribute
- property ctype
Return the class type for this component
- property local_name
Get the component name only within the context of the immediate parent container.
- property name
Get the fully qualified component name.