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 12 of file transport5.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
35
36
37
38 Scalar f freight in dollars per case per thousand miles /90/ ;
39 Scalar bmult demand multiplier /1/;
40
41 Parameter c(i,j) transport cost in thousands of dollars per case ;
42
43 c(i,j) = f * d(i,j) / 1000 ;
44
45 Variables
46 x(i,j) shipment quantities in cases
47 z total transportation costs in thousands of dollars ;
48
49 Positive Variable x ;
50
51 Equations
52 cost define objective function
53 supply(i) observe supply limit at plant i
54 demand(j) satisfy demand at market j ;
55
56 cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;
57
58 supply(i) .. sum(j, x(i,j)) =l= a(i) ;
59
60 demand(j) .. sum(i, x(i,j)) =g= bmult*b(j) ;
61
62 Model transport /all/ ;
63 Scalar ms 'model status', ss 'solve status'; '''
64
65
def get_model_text()
Definition: warehouse.py:17

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 78 of file transport5.py.

◆ checkpoint

transport5.checkpoint

Definition at line 76 of file transport5.py.

◆ cp

transport5.cp = ws.add_checkpoint()

Definition at line 72 of file transport5.py.

◆ t5

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

Definition at line 75 of file transport5.py.

◆ ws

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

Definition at line 68 of file transport5.py.