User Tools

Site Tools


gams:structure_a_large_gams_model

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gams:structure_a_large_gams_model [2013/05/03 15:18]
support
gams:structure_a_large_gams_model [2013/05/03 15:28]
support
Line 1: Line 1:
 ====== How do I structure a large GAMS model? ====== ====== How do I structure a large GAMS model? ======
  
-It makes sense to split a large GAMS model into different files in order to have a better overview of the GAMS program. A natural separation is to have the model algebra, input data and solution reporting in separate files. For example, it might be comfortable to know that the model algebra remains unchanged regardless of the modifications to data input file(s) and solution report file(s). Below you can find one suggestion that demonstrates the idea ({{wiki:​main.zip|download}}).+It makes sense to split a large GAMS model into different files in order to have a better overview of the GAMS program. A natural separation is to have the model algebra, input data and solution reporting in separate files. For example, it might be comfortable to know that the model algebra remains unchanged regardless of the modifications to data input file(s) and solution report file(s). Below you can find one suggestion that demonstrates the idea ({{:gams:​main.zip|download}}).
  
 File main.gms: File main.gms:
Line 29: Line 29:
 *) Remove intermediate and old files (input.gdx, report.xlsx,​ ...) *) Remove intermediate and old files (input.gdx, report.xlsx,​ ...)
 $call rm -f solution.gdx $call rm -f solution.gdx
-*) Read data(Database, Excel, ...), run model and save workfile+*) Read data (database, Excel, ...), run model and save workfile
 $call gams input.gms r=model s=wf1 %clp% $call gams input.gms r=model s=wf1 %clp%
 $if errorlevel 1 $abort errors in input.gms $if errorlevel 1 $abort errors in input.gms
Line 43: Line 43:
 File model.gms File model.gms
 <​code>​ <​code>​
-* We need to use empty data statements ​to allow data checks etc..+* We need to define the data (empty data is ok) to allow data checks etc..
 $ onempty $ onempty
   Sets   Sets
Line 113: Line 113:
 File report.gms: File report.gms:
 <​code>​ <​code>​
-* use command line parameter r=wf1 to execute only this part of the program+* use command line parameter r=wf1 to execute only file report.gms
  
  ​Display x.l, x.m ;  ​Display x.l, x.m ;
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/structure_a_large_gams_model.txt ยท Last modified: 2013/05/03 15:28 by support