Hello,
I have a code which runs a nested loop. The inner loop keeps updating and recording data, while the outer loop needs to reset all values each time before starting the inner loop. I was planning to use execute_unload and execute_load for this, but am having trouble getting it to work. Some pseudocode to explain what I am trying.
*set up all default data
parameter x /0/;
execute_unload 'defaultData.gdx'
loop(i,
execute_load 'defaultData.gdx' *;
loop(j,
*manipulate parameters
x=x+j
Objective=E=f(i,j)
solve model min Objective
)
)
The key is that the execute_load needs to overwrite all values (parameters included) to their default, at each instance of the outer loop. However, the execute_load statements seems to need to point to specific names, and can’t just load all values. I have over 900 parameters alone in my model, and can’t possibly type them all in. Also, as the model grows, it could become tedious to continue to update the pointing.
Is there anyway to accomplish this? To reset all values (parameters, variables, equations) back to their default values, without needing to explicitly point to them? For example, is there a wildcard option (*) like shown in the example? Any help is appreciatted.