transport10.py File Reference

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

Go to the source code of this file.

Functions

def transport10.get_model_text ()
 

Variables

 transport10.wb = open_workbook("..\\Data\\transport.xls")
 
 transport10.capacity = wb.sheet_by_name("capacity")
 
 transport10.demand = wb.sheet_by_name("demand")
 
 transport10.distance = wb.sheet_by_name("distance")
 
 transport10.ws = GamsWorkspace(system_directory = sys.argv[1])
 
 transport10.db = ws.add_database()
 
 transport10.i = db.add_set("i", 1, "Plants")
 
 transport10.j = db.add_set("j", 1, "Markets")
 
 transport10.capacity_param = db.add_parameter_dc("a", [i], "Capacity")
 
 transport10.demand_param = db.add_parameter_dc("b", [j], "Demand")
 
 transport10.distance_param = db.add_parameter_dc("d", [i,j], "Distance")
 
 transport10.value
 
 transport10.rowx
 
 transport10.colx
 
tuple transport10.keys = ( str(distance.cell_value(rowx=rx, colx=0)), str(distance.cell_value(rowx=0, colx=cx)) )
 
 transport10.rx
 
 transport10.t10 = ws.add_job_from_string(get_model_text())
 
 transport10.opt = ws.add_options()
 
 transport10.all_model_types
 
 transport10.databases
 

Detailed Description

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

Here we show:

  • How to fill a GamsDatabase by reading from MS Excel

Definition in file transport10.py.