I want use modelinstance to multiple optimize with a two-dimensional parameter and a one-dimensional parameters in python. When I try to follow the example transport7.py to updata the two-dimensional parameter,it comes the error:TypeError: unhashable type: 'GamsSetRecord'. I have already saved the two-dimensional parameter as a dictionary. The specific code is as follows, qta is the dict incluing the parameter,and the format is
{("key1","key2"):value}.
Code: Select all
for j in gmodel.out_db["i"]:
for k in gmodel.out_db["w"]:
Qtable.clear()
Qtable.add_record((j.key(0),k.key(0))).value = qta[(j,k)]
Thanks
Best wishes