transport12 Namespace Reference

Functions

def get_model_text ()
 
def guss_call (dict, mi, solve_statement, opt=None, mi_opt=None, output=None)
 

Variables

 ws = GamsWorkspace(system_directory = sys.argv[1])
 
 cp = ws.add_checkpoint()
 
 t12 = ws.add_job_from_string(get_model_text())
 
 checkpoint
 
 mi = cp.add_modelinstance()
 
list bmultlist = [ 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 ]
 
 db = ws.add_database()
 
 scen = db.add_set("scen", 1, "")
 
 bmult = db.add_parameter_dc("bmultlist", [scen])
 
 zscen = db.add_parameter_dc("zscen", [scen])
 
int i = 0
 
 value
 
 dict = db.add_set("dict",3,"")
 
 mi2 = cp.add_modelinstance()
 
 db2 = ws.add_database()
 
 scen2 = db2.add_set("scen", 1, "")
 
 zscen2 = db2.add_parameter_dc("zscen", [scen2])
 
 xup = db2.add_parameter("xup", 3, "")
 
 dict2 = db2.add_set("dict", 3, "")
 
 output
 

Function Documentation

◆ get_model_text()

def transport12.get_model_text ( )

Definition at line 10 of file transport12.py.

10def get_model_text():
11  return '''
12  Sets
13  i canning plants / seattle, san-diego /
14  j markets / new-york, chicago, topeka / ;
15 
16  Parameters
17 
18  a(i) capacity of plant i in cases
19  / seattle 350
20  san-diego 600 /
21 
22  b(j) demand at market j in cases
23  / new-york 325
24  chicago 300
25  topeka 275 / ;
26 
27  Table d(i,j) distance in thousands of miles
28  new-york chicago topeka
29  seattle 2.5 1.7 1.8
30  san-diego 2.5 1.8 1.4 ;
31 
32  Scalar f freight in dollars per case per thousand miles /90/ ;
33  Scalar bmult demand multiplier /1/;
34 
35  Parameter c(i,j) transport cost in thousands of dollars per case ;
36 
37  c(i,j) = f * d(i,j) / 1000 ;
38 
39  Variables
40  x(i,j) shipment quantities in cases
41  z total transportation costs in thousands of dollars ;
42 
43  Positive Variable x ;
44 
45  Equations
46  cost define objective function
47  supply(i) observe supply limit at plant i
48  demand(j) satisfy demand at market j ;
49 
50  cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;
51 
52  supply(i) .. sum(j, x(i,j)) =l= a(i) ;
53 
54  demand(j) .. sum(i, x(i,j)) =g= bmult*b(j) ;
55 
56  Model transport /all/ ;
57 '''
58 
59 
60 # Needs to be called with an uninstantiated GAMSModelInstance

◆ guss_call()

def transport12.guss_call (   dict,
  mi,
  solve_statement,
  opt = None,
  mi_opt = None,
  output = None 
)

Definition at line 61 of file transport12.py.

References markowitz.key.

Variable Documentation

◆ bmult

transport12.bmult = db.add_parameter_dc("bmultlist", [scen])

Definition at line 191 of file transport12.py.

◆ bmultlist

list transport12.bmultlist = [ 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 ]

Definition at line 186 of file transport12.py.

◆ checkpoint

transport12.checkpoint

Definition at line 181 of file transport12.py.

◆ cp

transport12.cp = ws.add_checkpoint()

Definition at line 177 of file transport12.py.

◆ db

transport12.db = ws.add_database()

Definition at line 188 of file transport12.py.

◆ db2

transport12.db2 = ws.add_database()

Definition at line 214 of file transport12.py.

◆ dict

transport12.dict = db.add_set("dict",3,"")

Definition at line 201 of file transport12.py.

◆ dict2

transport12.dict2 = db2.add_set("dict", 3, "")

Definition at line 226 of file transport12.py.

◆ i

int transport12.i = 0

Definition at line 194 of file transport12.py.

◆ mi

transport12.mi = cp.add_modelinstance()

Definition at line 184 of file transport12.py.

◆ mi2

transport12.mi2 = cp.add_modelinstance()

Definition at line 213 of file transport12.py.

◆ output

transport12.output

Definition at line 231 of file transport12.py.

◆ scen

transport12.scen = db.add_set("scen", 1, "")

Definition at line 190 of file transport12.py.

◆ scen2

transport12.scen2 = db2.add_set("scen", 1, "")

Definition at line 216 of file transport12.py.

◆ t12

transport12.t12 = ws.add_job_from_string(get_model_text())

Definition at line 180 of file transport12.py.

◆ value

transport12.value

Definition at line 196 of file transport12.py.

◆ ws

transport12.ws = GamsWorkspace(system_directory = sys.argv[1])

Definition at line 173 of file transport12.py.

◆ xup

transport12.xup = db2.add_parameter("xup", 3, "")

Definition at line 218 of file transport12.py.

◆ zscen

transport12.zscen = db.add_parameter_dc("zscen", [scen])

Definition at line 192 of file transport12.py.

◆ zscen2

transport12.zscen2 = db2.add_parameter_dc("zscen", [scen2])

Definition at line 217 of file transport12.py.

def get_model_text()
Definition: warehouse.py:16