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 14 of file transport7.py.

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

Variable Documentation

◆ all_model_types

transport7.all_model_types

Definition at line 79 of file transport7.py.

◆ bmult

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

Definition at line 77 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 85 of file transport7.py.

◆ checkpoint

transport7.checkpoint

Definition at line 73 of file transport7.py.

◆ cp

transport7.cp = ws.add_checkpoint()

Definition at line 69 of file transport7.py.

◆ mi

transport7.mi = cp.add_modelinstance()

Definition at line 76 of file transport7.py.

◆ opt

transport7.opt = ws.add_options()

Definition at line 78 of file transport7.py.

◆ t7

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

Definition at line 72 of file transport7.py.

◆ value

transport7.value

Definition at line 84 of file transport7.py.

◆ ws

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

Definition at line 65 of file transport7.py.

◆ x

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

Definition at line 98 of file transport7.py.

◆ xup

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

Definition at line 99 of file transport7.py.