BooleanVarData
(class from pyomo.core.base.boolean_var
)
- class pyomo.core.base.boolean_var.BooleanVarData(component=None)[source]
Bases:
ComponentData
,BooleanValue
This class defines the data for a single Boolean variable.
- Parameters:
component (Component) – The BooleanVar object that owns this data.
Methods
__init__
([component])associate_binary_var
(binary_var)Associate a binary VarData to this BooleanVarData
clear
()clear_suffix_value
(suffix_or_name[, expand])Set the suffix value for this component data
cname
(*args, **kwds)DEPRECATED.
equivalent_to
(other)Construct an EquivalenceExpression between this BooleanValue and its operand.
fix
([value, skip_validation])Fix the value of this variable (treat as nonvariable)
free
()Alias for
unfix()
Get the binary VarData associated with this BooleanVarData
get_suffix_value
(suffix_or_name[, default])Get the suffix value for this component data
getname
([fully_qualified, name_buffer, ...])Return a string with the component name and index
implies
(other)Construct an ImplicationExpression using method "implies"
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 if this variable is fixed, otherwise returns False.
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
Boolean values are not numeric.
Return False unless this class is a parameter object
Returns True because this is a variable.
Return True if this object is a reference.
DEPRECATED.
Returns True because this is a variable.
land
(other)Construct an AndExpression (Logical And) between this BooleanValue and other.
lor
(other)Construct an OrExpression (Logical OR) between this BooleanValue and other.
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.
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
(val[, skip_validation])Set the value of this numeric object, after validating its value.
to_string
([verbose, labeler, smap, ...])Return a string representation of the expression tree.
type
()DEPRECATED.
unfix
()Unfix this variable (treat as variable)
xor
(other)Construct an XorExpression using method "xor"
Attributes
Return the active attribute
Return the class type for this component
the domain for this variable.
Get the component name only within the context of the immediate parent container.
Get the fully qualified component name.
A Boolean indicating whether the value of this variable is Consistent with the most recent solve.
the current 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.
- equivalent_to(other)
Construct an EquivalenceExpression between this BooleanValue and its operand.
- fix(value=NOTSET, skip_validation=False)[source]
Fix the value of this variable (treat as nonvariable)
This sets the fixed indicator to True. If
value
is provided, the value (and theskip_validation
flag) are first passed toset_value()
.
- 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
- implies(other)
Construct an ImplicationExpression using method “implies”
- 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()
Boolean values are not numeric.
- is_parameter_type()
Return False unless this class is a parameter object
- is_reference()
Return True if this object is a reference.
- is_relational()
DEPRECATED.
Return True if this Logical value represents a relational expression.
Deprecated since version 6.4.3: is_relational() is deprecated in favor of is_expression_type(ExpressionType.RELATIONAL)
- land(other)
Construct an AndExpression (Logical And) between this BooleanValue and other.
- lor(other)
Construct an OrExpression (Logical OR) between this BooleanValue and other.
- 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.
- 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(val, skip_validation=False)[source]
Set the value of this numeric object, after validating its value. If the ‘valid’ flag is True, then the validation step is skipped.
- 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 the string representation consists of nested functions. Otherwise, the string representation is an algebraic equation. Defaults toFalse
.labeler – An object that generates string labels for variables in the expression tree. Defaults to
None
.
- 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.
- xor(other)
Construct an XorExpression using method “xor”
- property active
Return the active attribute
- property ctype
Return the class type for this component
- property domain
the domain for this variable.
- Type:
BooleanSet
- 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 stale
A Boolean indicating whether the value of this variable is Consistent with the most recent solve. True indicates that this variable’s value was set prior to the most recent solve and was not updated by the results returned by the solve.
- Type: