transport7 Namespace Reference

Functions

def get_model_text ()
 

Variables

 ws = GamsWorkspace(system_directory = sys.argv[1])
 
 cp = ws.add_checkpoint()
 
 t7 = ws.add_job_from_string(get_model_text())
 
 checkpoint
 
 mi = cp.add_modelinstance()
 
 bmult = mi.sync_db.add_parameter("bmult", 0, "demand multiplier")
 
 opt = ws.add_options()
 
 all_model_types
 
 value
 
list bmultlist = [ 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 ]
 
 x = mi.sync_db.add_variable("x", 2, VarType.Positive)
 
 xup = mi.sync_db.add_parameter("xup", 2, "upper bound on x")
 

Function Documentation

◆ get_model_text()

def transport7.get_model_text ( )

Definition at line 12 of file transport7.py.

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

Variable Documentation

◆ all_model_types

transport7.all_model_types

Definition at line 77 of file transport7.py.

◆ bmult

transport7.bmult = mi.sync_db.add_parameter("bmult", 0, "demand multiplier")

Definition at line 75 of file transport7.py.

◆ bmultlist

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

Definition at line 83 of file transport7.py.

◆ checkpoint

transport7.checkpoint

Definition at line 71 of file transport7.py.

◆ cp

transport7.cp = ws.add_checkpoint()

Definition at line 67 of file transport7.py.

◆ mi

transport7.mi = cp.add_modelinstance()

Definition at line 74 of file transport7.py.

◆ opt

transport7.opt = ws.add_options()

Definition at line 76 of file transport7.py.

◆ t7

transport7.t7 = ws.add_job_from_string(get_model_text())

Definition at line 70 of file transport7.py.

◆ value

transport7.value

Definition at line 82 of file transport7.py.

◆ ws

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

Definition at line 63 of file transport7.py.

◆ x

transport7.x = mi.sync_db.add_variable("x", 2, VarType.Positive)

Definition at line 96 of file transport7.py.

◆ xup

transport7.xup = mi.sync_db.add_parameter("xup", 2, "upper bound on x")

Definition at line 97 of file transport7.py.

def get_model_text()
Definition: warehouse.py:16