ArcData

(类来自 pyomo.network.arc)

class pyomo.network.arc.ArcData(component=None, **kwds)[source]

基础类:ActiveComponentData

此类定义了单个弧线的数据

source

当指定时,源端口,否则为None。别名为src。

Type:

端口

destination

当指定时为目标端口,否则为None。别名为dest。

Type:

端口

ports

一个包含两个端口的元组。如果是有方向的,则顺序为(源,目的地)。

Type:

元组

directed

如果是有向的则为True,否则为False

Type:

bool

expanded_block

对此弧放置扩展约束的块的引用

Type:

区块

__init__(component=None, **kwds)[源代码]

方法

__init__([component])

activate()

将活动属性设置为True

clear_suffix_value(suffix_or_name[, expand])

设置此组件数据的后缀值

cname(*args, **kwds)

已弃用。

deactivate()

将活动属性设置为False

get_suffix_value(suffix_or_name[, default])

获取此组件数据的后缀值

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(vals)

设置此弧线的端口属性

type()

已弃用。

属性

active

返回活动属性

ctype

返回此组件的类类型

dest

destination

directed

expanded_block

local_name

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

name

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

ports

source

src

成员文档

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)

获取此组件数据的后缀值

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(vals)[source]

设置此弧线的端口属性

type()

已弃用。

返回此组件的类类型

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

property active

返回活动属性

property ctype

返回此组件的类类型

property local_name

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

property name

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