ParamData
(class from pyomo.core.base.param
)
- class pyomo.core.base.param.ParamData(component)[source]
Bases:
ComponentData
,NumericValue
This class defines the data for a mutable parameter.
- Constructor Arguments:
owner The Param object that owns this data. value The value of this parameter.
- Public Class Attributes:
value The numeric value of this variable.
Methods
__init__
(component)clear
()Clear the data in this component
clear_suffix_value
(suffix_or_name[, expand])Set the suffix value for this component data
cname
(*args, **kwds)DEPRECATED.
get_suffix_value
(suffix_or_name[, default])Get the suffix value for this component data
Return the units for this ParamData
getname
([fully_qualified, name_buffer, ...])Return a string with the component name and index
index
()Returns the index of this ComponentData instance relative to the parent component index set.
Return True if this class is a Pyomo component
Returns False because this is not a constant in an expression.
is_expression_type
([expression_system])Return True if this numeric value is an expression
is_fixed
()Returns True because this value is fixed.
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
Returns True because this is a parameter object.
Return True if variables can appear in this expression
Return True if this object is a reference.
DEPRECATED.
Return False unless this class is a variable object
model
()Return the model of the component that owns this data.
Return the parent of the component that owns this data.
Returns the component associated with this object.
Return the polynomial degree of the expression.
pprint
([ostream, verbose, prefix])Print component information
set_suffix_value
(suffix_or_name, value[, expand])Set the suffix value for this component data
set_value
(value[, idx])Set the value of this ParamData object, performing unit conversion and validation as necessary.
to_string
([verbose, labeler, smap, ...])Return a string representation of the expression tree.
type
()DEPRECATED.
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.
Return the value for this variable.
Member Documentation
- clear_suffix_value(suffix_or_name, expand=True)
Set 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)
Get the suffix value for this component data
- getname(fully_qualified=False, name_buffer=None, relative_to=None)
Return a string with the component name and index
- index()
Returns the index of this ComponentData instance relative to the parent component index set. None is returned if this instance does not have a parent component, or if - for some unknown reason - this instance does not belong to the parent component’s index set.
- 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_indexed()
Return true if this component is indexed
- 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_potentially_variable()
Return True if variables can appear in this expression
- is_reference()
Return True if this object is a reference.
- is_relational()
DEPRECATED.
Return True if this numeric value represents a relational expression.
Deprecated since version 6.4.3: is_relational() is deprecated in favor of is_expression_type(ExpressionType.RELATIONAL)
- is_variable_type()
Return False unless this class is a variable object
- model()
Return the model of the component that owns this data.
- parent_block()
Return the parent of the component that owns this data.
- parent_component()
Returns the component associated with this object.
- polynomial_degree()
Return the polynomial degree of the expression.
- Returns:
None
- pprint(ostream=None, verbose=False, prefix='')
Print component information
Note that this method is generally only reachable through ComponentData objects in an IndexedComponent container. Components, including unindexed Component derivatives and both scalar and indexed IndexedComponent derivatives will see
Component.pprint()
- set_suffix_value(suffix_or_name, value, expand=True)
Set the suffix value for this component data
- set_value(value, idx=NOTSET)[source]
Set the value of this ParamData object, performing unit conversion and validation as necessary.
- to_string(verbose=None, labeler=None, smap=None, compute_values=False)
Return a string representation of the expression tree.
- Parameters:
verbose (bool) – If
True
, then the string representation consists of nested functions. Otherwise, the string representation is an infix algebraic equation. Defaults toFalse
.labeler – An object that generates string labels for non-constant in the expression tree. Defaults to
None
.smap – A SymbolMap instance that stores string labels for non-constant nodes in the expression tree. Defaults to
None
.compute_values (bool) – If
True
, then fixed expressions are evaluated and the string representation of the resulting value is returned.
- Returns:
A string representation for the expression tree.
- type()
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.
- property value
Return the value for this variable.