参数列表

(类来自 pyomo.core.kernel.parameter)

class pyomo.core.kernel.parameter.parameter_list(*args, **kwds)

基础类:ListContainer

用于具有类别类型 IParameter 的对象的列表样式容器

__init__(*args, **kwds)

方法

__init__(*args, **kwds)

activate([shallow])

激活此容器。

append(value)

S.append(value) -- 将值追加到序列的末尾

child(key)

获取与此容器关联的给定存储键的子对象。

children()

生成器遍历此容器的子元素。

clear()

clone()

返回此对象的副本,并将父指针设置为None

components([active])

生成对此容器下存储的所有组件的高效遍历。

count(value)

deactivate([shallow])

停用此容器。

extend(values)

S.extend(iterable) -- 通过从可迭代对象中追加元素来扩展序列

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

动态生成此对象的名称。

index(value, [start, [stop]])

如果值不存在,则引发ValueError。

insert(i, item)

S.insert(index, object) -- 在索引前插入对象

pop([index])

如果列表为空或索引超出范围,则引发IndexError。

remove(value)

S.remove(value) -- 移除第一次出现的值。

reverse()

S.reverse() -- 反转 原地

属性

active

此对象的活动状态。

ctype

对象的类别类型。

local_name

对象在其父级上下文中的本地名称。

name

对象的完全限定名称。

parent

对象的父级(可能为None)。

storage_key

对象在其父级中的存储键

成员文档

activate(shallow=True)

激活此容器。

append(value)

S.append(value) – 将值追加到序列的末尾

child(key)

获取与此容器关联的给定存储键的子对象。

Raises:

KeyError – 如果参数不是此容器的任何子项的存储键

children()

生成器遍历此容器的子元素。

clear() None -- remove all items from S
clone()

返回此对象的副本,并将父指针设置为None

克隆几乎等同于深拷贝,除了遇到的任何分类对象如果不是该对象的后代,将在克隆上引用相同的对象。

components(active=True)

生成对此容器下存储的所有组件的高效遍历。组件是分类的对象,它们要么是(1)非容器,要么是(2)异构容器。

Parameters:

active (True/None) – 控制是否过滤迭代以仅包括存储树的活跃部分。默认值为True。将此关键字设置为None会导致忽略对象的活跃状态。

Returns:

存储树中的组件迭代器

count(value) integer -- return number of occurrences of value
deactivate(shallow=True)

停用此容器。

extend(values)

S.extend(iterable) – 通过从可迭代对象中追加元素来扩展序列

getname(fully_qualified=False, name_buffer={}, convert=<class 'str'>, relative_to=None)

动态生成此对象的名称。

Parameters:
  • fully_qualified (bool) – 通过迭代所有祖先容器生成完整名称。 默认值为 False

  • convert (function) – 一个将存储键转换为字符串表示的函数。默认是内置函数 str。

  • relative_to (object) – 在生成完全限定名称时,生成相对于此块的名称。

Returns:

如果存在父对象,此方法返回一个字符串,表示该对象在其父对象上下文中的名称;否则(如果不存在父对象),此方法返回None

index(value[, start[, stop]]) integer -- return first index of value.

如果值不存在,则引发ValueError。

insert(i, item)

S.insert(index, object) – 在索引前插入对象

pop([index]) item -- remove and return item at index (default last).

如果列表为空或索引超出范围,则引发IndexError。

remove(value)

S.remove(value) – 移除第一次出现的值。 如果值不存在,则引发ValueError。

reverse()

S.reverse() – 原地反转

property active

此对象的活动状态。

property ctype

对象的类别类型。

property local_name

对象在其父级上下文中的本地名称。是 obj.getname(fully_qualified=False)的别名。

property name

对象的完全限定名称。obj.getname(fully_qualified=True)的别名。

property parent

对象的父级(可能为None)。

property storage_key

对象在其父级中的存储键