No Matches
alias.py File Reference

The GAMS Control API does not have the concept of a GAMS alias. More...

Go to the source code of this file.


def alias.same_gdx_dump (ws, gdxfile, expected_result)
def alias.check_alias_logic (prefix, db)


str alias.GDX_DUMP2
str alias.GDX_DUMP1
str alias.GAMS_DATA
sys alias.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None
GamsWorkspace alias.ws = GamsWorkspace(system_directory=sys_dir)
GamsWorkspace alias.job = ws.add_job_from_string(GAMS_DATA)
GamsWorkspace alias.db = ws.add_database(source_database=job.out_db)
GamsWorkspace alias.db2 = ws.add_database()
GamsWorkspace alias.ii = db2.add_set_dc(db["ii"].name, ["*"], db["ii"].text)
GamsWorkspace alias.aa_orig = db["aa"]
GamsWorkspace alias.aa = db2.add_parameter_dc(db["aa"].name, [ii], db["aa"].text)

Detailed Description

The GAMS Control API does not have the concept of a GAMS alias.

An alias cannot be entered into a GamsDatabase by API methods. Nevertheless, if the GamsDatabase is loaded from a GDX container (e.g. the GamsJob.out_db), the database can contain aliases. Such an alias can be retrieved as a GamsSet and consists of the elements of the aliased set. The method to find out if a GamsSet in a GamsDatabase is indeed an alias is to check if the symbol name is different from the lookup name (i.e. is_alias = db["ii"].name != "ii"). This example model goes through the logic of how aliases are handled in the GAMS Control API.

Definition in file alias.py.