Hello friends,
Longtime reader, first time poster!
(Note: I believe this is a question for syntax rather than modeling (or another grouping) but if I am wrong I am happy to repost in the appropriate place.)
I am trying to run several component gms files at once using a master gms file. Each component gms file is all written to solve the same model, but each file has slight variation in set elements or parameter values (for a little background, these variations are meant to characterize different market structures or policy shocks).
The problem I am having is that the results from each component gms file vary depending on the order in which the gms files are included. This suggests to me that some values from the run of the first gms file persist through the second gms file, and so forth.
Is there a simple way to clear ALL variable and parameter values (and if need be, set values) before including each gms file? The only relevant command I can find is “clear” but it is indicated in the user guide that this is performed during compilation and not execution. It seems to me that I would need the values cleared during execution.
My file structure is the following:
Master gams file with code that
-loads in gdx data
-defines sets
-defines some parameters and assigns values to these parameters; these parameters are unchanged throughout all of the gms files included
-defines remaining parameters that are assigned values in each of the gms files
-defines the model (including variables and equations) that is solved in each of the gms files
Further down in this same master gms file, I include multiple gms files. Each gms file that I include takes about an hour to solve (hence the desire to click run and walk away) and has the following structure:
-assigning parameter values to those defined in the master data
-assigning initial guesses to the model variables using the assigned parameter values
-solving the model
-dumping the results into a gdx file
I hope this is clear enough, but I am happy to edit or respond with clarifications. Thank you in advance!