逻辑约束数据

(类来自 pyomo.core.base.logical_constraint)

class pyomo.core.base.logical_constraint.LogicalConstraintData(expr=None, component=None)[源代码]

基础类:ActiveComponentData

此类定义了单个通用逻辑约束的数据。

Constructor arguments:
component

拥有此数据的LogicalStatement对象。

expr

存储在此逻辑约束中的Pyomo表达式。

Public class attributes:
active

一个布尔值,如果此逻辑约束在模型中处于活动状态,则为真。

expr

此逻辑约束的Pyomo表达式

Private class attributes:
_component

逻辑约束组件。

_active

一个布尔值,表示此数据是否处于活动状态

__init__(expr=None, component=None)[来源]

方法

__init__([expr, component])

activate()

将活动属性设置为True

clear_suffix_value(suffix_or_name[, expand])

设置此组件数据的后缀值

cname(*args, **kwds)

已弃用。

deactivate()

将活动属性设置为False

get_suffix_value(suffix_or_name[, default])

获取此组件数据的后缀值

get_value()

获取此逻辑约束上的表达式。

getname([fully_qualified, name_buffer, ...])

返回包含组件名称和索引的字符串

index()

返回此ComponentData实例相对于父组件索引集的索引。

is_component_type()

如果此类是Pyomo组件,则返回True

is_expression_type([expression_system])

如果此数值是一个表达式,则返回 True

is_indexed()

如果此组件已索引,则返回true

is_logical_type()

如果此类是Pyomo布尔对象,则返回True。

is_named_expression_type()

如果此数值是一个命名表达式,则返回 True

is_numeric_type()

如果此类是Pyomo数值对象,则返回True

is_parameter_type()

除非此类是参数对象,否则返回 False

is_reference()

如果此对象是引用,则返回 True。

is_variable_type()

除非此类是变量对象,否则返回 False

model()

返回拥有此数据的组件的模型。

parent_block()

返回拥有此数据的组件的父组件。

parent_component()

返回与此对象关联的组件。

pprint([ostream, verbose, prefix])

打印组件信息

set_suffix_value(suffix_or_name, value[, expand])

设置此组件数据的后缀值

set_value(expr)

在此逻辑约束上设置表达式。

type()

已弃用。

属性

active

返回活动属性

body

访问逻辑约束表达式的主体。

ctype

返回此组件的类类型

expr

返回与此逻辑约束关联的表达式。

local_name

仅在直接父容器的上下文中获取组件名称。

name

获取完全限定的组件名称。

成员文档

activate()

将活动属性设置为True

clear_suffix_value(suffix_or_name, expand=True)

设置此组件数据的后缀值

cname(*args, **kwds)

已弃用。

自版本5.0起已弃用:cname() 方法已重命名为 getname()。 获取组件名称的首选方法是使用 .name 属性,该属性返回完全限定的组件名称。 .local_name 属性将仅在直接父容器的上下文中返回组件名称。

deactivate()

将活动属性设置为False

get_suffix_value(suffix_or_name, default=None)

获取此组件数据的后缀值

get_value()[source]

获取此逻辑约束上的表达式。

getname(fully_qualified=False, name_buffer=None, relative_to=None)

返回包含组件名称和索引的字符串

index()

返回此ComponentData实例相对于父组件索引集的索引。如果此实例没有父组件,或者由于某些未知原因此实例不属于父组件的索引集,则返回None。

is_component_type()

如果此类是Pyomo组件,则返回True

is_expression_type(expression_system=None)

如果此数值是一个表达式,则返回 True

is_indexed()

如果此组件已索引,则返回true

is_logical_type()

如果此类是Pyomo布尔对象,则返回True。

布尔对象包括常量、变量或逻辑表达式。

is_named_expression_type()

如果此数值是一个命名表达式,则返回 True

is_numeric_type()

如果此类是Pyomo数值对象,则返回True

is_parameter_type()

除非此类是参数对象,否则返回 False

is_reference()

如果此对象是引用,则返回 True。

is_variable_type()

除非此类是变量对象,否则返回 False

model()

返回拥有此数据的组件的模型。

parent_block()

返回拥有此数据的组件的父组件。

parent_component()

返回与此对象关联的组件。

pprint(ostream=None, verbose=False, prefix='')

打印组件信息

请注意,此方法通常只能通过IndexedComponent容器中的ComponentData对象访问。组件,包括未索引的Component派生类以及标量和索引的IndexedComponent派生类,将会看到Component.pprint()

set_suffix_value(suffix_or_name, value, expand=True)

设置此组件数据的后缀值

set_value(expr)[来源]

在此逻辑约束上设置表达式。

type()

已弃用。

返回此组件的类类型

自版本5.7起已弃用:Component.type() 方法已被 .ctype 属性取代。

property active

返回活动属性

property body

访问逻辑约束表达式的主体。

property ctype

返回此组件的类类型

property expr

返回与此逻辑约束关联的表达式。

property local_name

仅在直接父容器的上下文中获取组件名称。

property name

获取完全限定的组件名称。