Given this set and constraint definition
<code>index_set_a = pyo.Set(initialize=[(p, j) for p in model.Units for j in model.YEARS])
model.a = pyo.Constraint(index_set_a, rule=rule_a)
</code>
<code>index_set_a = pyo.Set(initialize=[(p, j) for p in model.Units for j in model.YEARS])
model.a = pyo.Constraint(index_set_a, rule=rule_a)
</code>
index_set_a = pyo.Set(initialize=[(p, j) for p in model.Units for j in model.YEARS])
model.a = pyo.Constraint(index_set_a, rule=rule_a)
is it possible to access the set’s “dimension names”, i.e. “Units” and “YEARS”, from model.a.index_set()
, e.g. for output purposes to print dual values and having telling names for index positions?
Note: Doing output processing of pyomo Var
s the equivalent names I am after are available in the var.index_set.subsets()
list and the .name
property for each list element which correspond to the “dimension names”.