transport5 Namespace Reference

Functions

def get_model_text ()
 

Variables

 ws = GamsWorkspace(system_directory = sys.argv[1])
 
 cp = ws.add_checkpoint()
 
 t5 = ws.add_job_from_string(get_model_text())
 
 checkpoint
 
list bmultlist = [ 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 ]
 

Function Documentation

◆ get_model_text()

def transport5.get_model_text ( )

Definition at line 13 of file transport5.py.

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

Variable Documentation

◆ bmultlist

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

Definition at line 79 of file transport5.py.

◆ checkpoint

transport5.checkpoint

Definition at line 77 of file transport5.py.

◆ cp

transport5.cp = ws.add_checkpoint()

Definition at line 73 of file transport5.py.

◆ t5

transport5.t5 = ws.add_job_from_string(get_model_text())

Definition at line 76 of file transport5.py.

◆ ws

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

Definition at line 69 of file transport5.py.