替换索引

(函数来自 pyomo.util.slices)

pyomo.util.slices.replace_indices(index, location_set_map, sets)[source]

使用location_set_mapindex中的值替换为切片或省略号。

参数:

index: tuple or scalar

要替换其值的索引

location_set_map: dict

将索引中的位置(“索引”)映射到它们对应的集合

sets: pyomo.common.collections.ComponentSet

包含要替换为切片的集合

返回:

tuple: 索引值被切片替换