Loading...
Searching...
No Matches
transport10.py File Reference

This is the 10th model in a series of examples. More...

Go to the source code of this file.

Variables

str transport10.GAMS_MODEL
 
sys transport10.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None
 
GamsWorkspace transport10.ws = GamsWorkspace(system_directory=sys_dir)
 
load_workbook transport10.wb
 
load_workbook transport10.capacity = wb["capacity"]
 
load_workbook transport10.demand = wb["demand"]
 
load_workbook transport10.distance = wb["distance"]
 
GamsWorkspace transport10.db = ws.add_database()
 
GamsWorkspace transport10.i = db.add_set("i", 1, "Plants")
 
GamsWorkspace transport10.j = db.add_set("j", 1, "Markets")
 
GamsWorkspace transport10.capacity_param = db.add_parameter_dc("a", [i], "Capacity")
 
GamsWorkspace transport10.demand_param = db.add_parameter_dc("b", [j], "Demand")
 
GamsWorkspace transport10.distance_param = db.add_parameter_dc("d", [i, j], "Distance")
 
transport10.key = c[0].value
 
 transport10.value
 
tuple transport10.keys
 
load_workbook transport10.v = distance.cell(row=r, column=c).value
 
GamsWorkspace transport10.job = ws.add_job_from_string(GAMS_MODEL)
 
GamsWorkspace transport10.opt = ws.add_options()
 
 transport10.all_model_types
 
 transport10.databases
 

Detailed Description

This is the 10th model in a series of examples.

Here we show:

  • How to fill a GamsDatabase by reading from MS Excel

Definition in file transport10.py.