Bypass = ampl.getParameter("XH")The error message is presented as:
Bypass.setValues({['H1','C1']:0.2})
Bypass.setValues({['H1','C1']:0.2})
TypeError: unhashable type: 'list'
I also tried to use ''Bypass.setValues({[0]:0.2})'' to modify the first element, it lead to the same error information.
Can someone tell me the right way to index the element when there is more than one dimension for the parameter ?
Thank you very much for the help !
x = ampl.getVariable('T')
xo = x.getValues()
x1 = x['C1',7]
Bypass = ampl.getParameter("XH")
Bypass['H1','C1']=0.5
t = ampl.getVariable('T')
to = t.getValues()
t1 = t['C1',7]
print (x1-t1)
The error message is that "unsupported operand type(s) for -: 'Variable' and 'Variable'". How should I extract the pure value from
the variable in the ampl, so I can proceed with math calculations?
Best wishes,
Rupu