transport11.py File Reference

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

Go to the source code of this file.

Functions

def transport11.get_base_model_text ()
 
def transport11.get_model_text ()
 
def transport11.create_save_restart (cp_file_name)
 

Variables

 transport11.w_dir = os.path.join(".", "tmp")
 
list transport11.plants = [ "Seattle", "San-Diego" ]
 
list transport11.markets = [ "New-York", "Chicago", "Topeka" ]
 
dictionary transport11.capacity = { "Seattle": 350.0, "San-Diego": 600.0 }
 
dictionary transport11.demand = { "New-York": 325.0, "Chicago": 300.0, "Topeka": 275.0 }
 
dictionary transport11.distance
 
 transport11.ws = GamsWorkspace(w_dir, sys.argv[1])
 
 transport11.db = ws.add_database()
 
 transport11.i = db.add_set("i", 1, "canning plants")
 
 transport11.j = db.add_set("j", 1, "markets")
 
 transport11.a = db.add_parameter_dc("a", [i], "capacity of plant i in cases")
 
 transport11.value
 
 transport11.b = db.add_parameter_dc("b", [j], "demand at market j in cases")
 
 transport11.d = db.add_parameter_dc("d", [i,j], "distance in thousands of miles")
 
 transport11.f = db.add_parameter("f", 0, "freight in dollars per case per thousand miles")
 
 transport11.cp_base = ws.add_checkpoint("tbase")
 
 transport11.t4 = ws.add_job_from_string(get_model_text(), cp_base)
 
 transport11.opt = ws.add_options()
 
 transport11.all_model_types
 
 transport11.databases
 

Detailed Description

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

Here we show:

  • How to create and use a save/restart file

Definition in file transport11.py.