10from gams
import GamsWorkspace
11import gams.transfer
as gt
13if __name__ ==
"__main__":
14 sys_dir = sys.argv[1]
if len(sys.argv) > 1
else None
15 ws = GamsWorkspace(system_directory=sys_dir)
17 ws.gamslib(
"trnsport")
18 job = ws.add_job_from_file(
"trnsport.gms")
22 os.path.join(ws.working_directory, job.out_db.name +
".gdx"), sys_dir
26 print(f
"m.listSymbols(): {m.listSymbols()}")
27 print(f
"m.listSets(): {m.listSets()}")
28 print(f
"m.listParameters(): {m.listParameters()}")
29 print(f
"m.listVariables(): {m.listVariables()}")
30 print(f
"m.listEquations(): {m.listEquations()}")
33 print(f
"m.data['i'].summary: {m.data['i'].summary}")
34 print(f
"m.data['i'].records:\n{m.data['i'].records}")
41 records=[(
"t" + str(i), i)
for i
in range(10)],
42 description=
"new data",
46 m.write(
"transport_out.gdx")