Using Savepoints for Data Collection - an Example
$title data collection for scenarios
$eolcom //
variable obj, x; equation objdef; objdef.. obj =e= x;
model m / objdef /;
m.solvelink=2; // will spawn optimizer
m.savepoint=2; // will write solution to gdx file
set s / m_p1*m_p5 /;
parameter xsol(s);
scalar i;
*for(i=1 to 5,
* x.fx = i;
loop(s,
x.fx = ord(s);
solve m us lp min obj;
m.limrow=0; m.limcol=0; m.solprint=2 );
execute 'gdxmerge m_p*.gdx';
execute_load 'merged.gdx' xsol=x.l;
display xsol;