User Tools

Site Tools


interfaces:using_savepoints_for_data_collection_-_an_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

interfaces:using_savepoints_for_data_collection_-_an_example [2007/08/10 10:20] (current)
Line 1: Line 1:
 +====== Using Savepoints for Data Collection - an Example ======
  
 +<​code>​
 +$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;
 +</​code>​
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY interfaces/using_savepoints_for_data_collection_-_an_example.txt ยท Last modified: 2007/08/10 10:20 (external edit)