Hi Ines,
If you are a Windows user: goto http://www3.lei.wur.nl/gamstools/
and download the tools. One of the tools is GDXmerge2.exe
This should do what you want.
Another way of merging variables from GDX files is to write some GAMS code that will load and combine the data.
Best wishes
Wietse
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
gamsworld+...@googlegroups.com.
To post to this group, send email to
gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
parameter mpar(i,j,k) Merged parA and parB
par (j,k) parA and parB wihtout dimension i;
* Remove the additional index i
par(j,k) = sum(i, mpar(i,j,k));
Do you have any ideia on how to do this with variables?
Thanks,
Inês
Hi Ines,
For a variable you can do
variable mvar(i,j,k) Merged varA and parB
var (j,k) varA and varB wihtout dimension i;
* Remove the additional index i
var.l(j,k) = sum(i, mvar.l(i,j,k));
var.up(j,k) = sum(i, mvar.up(i,j,k));
var.lo(j,k) = sum(i, mvar.lo(i,j,k));
var.m(j,k) = sum(i, mvar.m(i,j,k));
But the question remains: do you want to merge or aggregate?
Suppose I have a simulation model with variable outcome(Product,Year)
And I first run the model for Year=2014 getting Run1.gdx (with variable outcome in it).
Then run with Year=2015 and creating Run2.gdx…
No I want to merge the outcome(Product,Year), then I would write GAMS:
Set Year/2014,2015/;
Set Product/…./;
Variable outcome(Product,Year);
$onmulti
$gdxin “Run1.gdx”
$load outcome
$gdxin
$gdxin “Run2.gdx”
$load outcome
$gdxin
Execute_unload “Combined.gdx”,outcome,Product,Year;
Please do not forget the $onmulti
Here the onmulti will ensure that if values (set combinations) that were already having a value in Run1.gdx will be overwritten with values from Run2.gdx. If you want the values to add up then the approach at the start of the mail should be taken, but again highly questionable because how can you add-up lower and upper values as well as marginal values?
Greetings
Wietse
"I first run the model for Year=2014 getting Run1.gdx (with variable outcome in it).
Then run with Year=2015 and creating Run2.gdx " Correct.
In Run1.gdx file I have outcome(2014)
In Run2.gdx I have outcome (2015)
In my final gdx file I would like to have outcome(year), in this, case outcome(2014) and outcome(2015).
If I merge I will have: outcome(runX, year). (Not what I want)
I didn't want to do what you suggested earlier because I have more than 600 variables and more than 10 runs.
For each run I have to change the name of the variables (Moutcome(year) ), then merge, and then remove the extra index to outcome(year).
But maybe that's the only way...
Thanks again,
Inês
Hi Ines,
For a variable you can do
From: Ines [mailto:inessvi...@gmail.com]