Question on double dash parameters and populating a .gdx file with the command line

Hello,

I’m relatively new to GAMs and have managed to get myself confused in trying to create some double-dash parameters. Apologies in advance if I am just missing something obvious…

The issue is this: right now I am feeding the model data through $gdxrrw and $gdx in over an excel sheet, however it would be optimal for database management purposes to skip the excel procedure entirely. I recently stumbled across double-dash parameters, which seems like it could potentially solve the issue and have written the following (in a .gms file):

set g goods /good1, good2/;
set h households /hh1, hh2/;

parameter consumed(g,h) the quantity consumed of good “g” by household “h”.

Next, I was hoping to create a python script that would enter the values for each of the 4 combinations possible:
call gams filename --consumed(good1, hh1)=100, --consumed(good2, hh1)=200, --consumed(good1, hh2)=100, --consumed(good2, hh2)=200

However, it is not clear to me how this would work. The manual states that I should have defined the variables in GAMs as something akin to:
parameter consumed(“%g%”,“%h%”)=%value%;
However, this doesn’t work as %g% isn’t defined. What am I missing here? Thanks!

As a quick followup, I have managed to get the “run.bat” file operational and the remaining issue is how to tell GAMs that I want to setup parameter values that are double dash parameters. I have tried:


set g goods /good1, good2/;
set h households /hh1, hh2/;

parameter consumed(g,h) the quantity consumed of good “g” by household “h”.

consumed(“good1”,“hh1”)=%num1%;
consumed(“good2”,“hh1”)=%num2%;
consumed(“good1”,“hh2”)=%num3%;
consumed(“good2”,“hh2”)=%num4%;

However, the 4 lines above do not seem to be possible as GAMs does not recognize “%num1” etc. Am I missing some earlier step?