Go to the source code of this file.
Functions | |
def | alias.gdxdump2 () |
def | alias.gdxdump1 () |
def | alias.get_data_text () |
def | alias.same_gdx_dump (ws, gdxfile, expected_result) |
def | alias.my_assert (test, msg) |
def | alias.check_alias_logic (prefix, alias_db) |
Variables | |
alias.ws = GamsWorkspace(system_directory = sys.argv[1]) | |
alias.j1 = ws.add_job_from_string(get_data_text()) | |
alias.db = ws.add_database(source_database= j1.out_db) | |
alias.db2 = ws.add_database() | |
alias.ii = db2.add_set_dc(db["ii"].name, ["*"], db["ii"].text) | |
alias.aa_orig = db["aa"] | |
alias.aa = db2.add_parameter_dc(db["aa"].name, [ii], db["aa"].text, ) | |
Detailed Description
The Object-oriented 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. bool isAlias = db["ii"].name != "ii"). This example model goes through the logic of how aliases are handled in the Object-oriented API.
Definition in file alias.py.