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

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

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

◆ checkpoint

transport5.checkpoint

Definition at line 75 of file transport5.py.

◆ cp

transport5.cp = ws.add_checkpoint()

Definition at line 71 of file transport5.py.

◆ t5

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

Definition at line 74 of file transport5.py.

◆ ws

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

Definition at line 67 of file transport5.py.

def get_model_text()
Definition: warehouse.py:16