Suppose I have a lot of variables in mdl1. After saving mdl1 in a .sav and .lp, I read it back into doCPlex.
mdl2 = ModelReader.read(filename)
Now I want to recreate all the variables in mdl2. How to do that? Suppose I know the variables' names are 'variable1', 'variable2', 'variable3'. I would want to do something like
variable1 = mdl_2.get_var_by_name('variable1')
However, there might be hundreds of variables, I cannot afford to hand-tpye them in. So I want to use something like
eval("variable1 = mdl_2.get_var_by_name('variable1')")
But that did not work for me. Any help? Thanks!