normalize_index

(函数来自 pyomo.core.base.indexed_component)

pyomo.core.base.indexed_component.normalize_index(x)[source]

标准化组件索引。

这将嵌套序列展平为单个元组。有一个“全局”标志(normalize_index.flatten),可以关闭整个Pyomo中的索引展平。

标量值将保持不变。具有单个值的元组将被解包并作为单个值返回。

Return type:

标量或tuple