子类

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

class pyomo.core.base.block.SubclassOf(*ctype)[source]

基础类:object

这模拟了一个基于子类关系的类似元组的接口。

此类的实例提供了一个类似元组的接口,用于PseudoMap ctype / descend_into。构造函数接受一个单一的ctype参数。当与PseudoMap一起使用时(通过像component_objects()这样的Block API),它将匹配任何作为参考ctype子类的ctype。

这允许,例如:

model.component_data_objects(Var, descend_into=SubclassOf(Block))

__init__(*ctype)[source]

方法

__init__(*ctype)

成员文档