I am solving an MINLP using Pyomo, which takes a vector of integer inputs(the link capacities of a graph) and returns the packet loss in the network.What the edge_enum dictionary does is, it enumerates all edges of the graph.e.g.,
{0: (0, 4),
1: (1, 4),
2: (1, 5), ...
a=0
for e in G.edges():
edge_enum[a]=e
a+=1
model=ConcreteModel
key_list=list(edge_enum.keys())
edge_list=list(edge_enum.values())
model.A=Set(initialize=edge_list)
lb={}
for j in edge_list:
lb[j]=pmf_maxima(j,lamd,q)
ub={}
for j in edge_list:
ub[j]=pmf_length(j,lamd,q)
def fb(model,i):
return (lb[i],ub[i])
model.vars=Var(model.A,domain=PositiveIntegers,bounds=fb)
print(model.vars[edge_enum[0]].value)
My query is ,how can I access each element of the variable vector 'vars' ,because thats my input capacity vector. I need to access each of them to define my objective function.