Loading...
Searching...
No Matches
gt_example1.py
Go to the documentation of this file.
6
7import os
8import sys
9from gams import GamsWorkspace
10import gams.transfer as gt
11
12if __name__ == "__main__":
13 sys_dir = sys.argv[1] if len(sys.argv) > 1 else None
14 ws = GamsWorkspace(system_directory=sys_dir)
15
16 ws.gamslib("trnsport")
17 job = ws.add_job_from_file("trnsport.gms")
18 job.run()
19
20 # load all GDX data
21 m = gt.Container(
22 os.path.join(ws.working_directory, job.out_db.name + ".gdx"), sys_dir
23 )
24
25 # add data to the new_gdx
26 m.write("transport_out.gdx")