GDXDIFFExample16.gms : Compares two GDX files and writes the difference to a third GDX file

Description

This program compares the data of symbols with the same name, type and
dimension in two GDX files and writes the differences to a third GDX
file based on the data of the trnsport model using GDXDIFF. The differences
are loaded and displayed in the listing file afterwards.

This model is referenced in "Compares two GDX files and writes the difference
to a third GDX file" from the GDXDIFF documentation.


Category : GAMS Data Utilities library


Main file : GDXDIFFExample16.gms   includes :  GDXDIFFExample16.gms  trnsport.gms

$title Compares two GDX files and writes the difference to a third GDX file (GDXDIFFExample16,SEQ=028)

$onText
This program compares the data of symbols with the same name, type and
dimension in two GDX files and writes the differences to a third GDX
file based on the data of the trnsport model using GDXDIFF. The differences
are loaded and displayed in the listing file afterwards.

This model is referenced in "Compares two GDX files and writes the difference
to a third GDX file" from the GDXDIFF documentation.
$offText

$include trnsport.gms

* solve and write to unmodified.gdx before manipulating the data
solve transport using lp minimizing z;
execute_unload 'unmodified.gdx', a, x;

* manipulate the data and solve again, write to modified.gdx
a('seattle') = 1.2*a('seattle');
solve transport using lp minimizing z;
execute_unload 'modified.gdx', a, x;

execute 'gdxdiff unmodified modified diffile > %system.nullfile%';

* Declare symbols to hold the data for differences
Set difftags / dif1, dif2, ins1, ins2 /;
Variable xdif(i,j,difftags);
Parameter adif(i,difftags);

execute_load 'diffile' adif=a, xdif=x;
display adif, xdif.l;