transport6 Namespace Reference

Functions

def get_model_text ()

def run_scenario (workspace, checkpoint, io_lock, b)

Variables

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

checkpoint

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

target

run_scenario

args

◆ get_model_text()

 def transport6.get_model_text ( )

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

◆ run_scenario()

 def transport6.run_scenario ( workspace, checkpoint, io_lock, b )

Definition at line 61 of file transport6.py.

References run_scenario.

◆ args

 transport6.args

Definition at line 90 of file transport6.py.

◆ bmultlist

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

Definition at line 84 of file transport6.py.

◆ checkpoint

 transport6.checkpoint

Definition at line 83 of file transport6.py.

◆ cp

Definition at line 79 of file transport6.py.

◆ io_lock

Definition at line 87 of file transport6.py.

◆ run_scenario

 transport6.run_scenario

Definition at line 90 of file transport6.py.

Referenced by run_scenario().

◆ t6

Definition at line 82 of file transport6.py.

◆ target

 transport6.target

Definition at line 90 of file transport6.py.

Definition at line 88 of file transport6.py.

◆ ws

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

Definition at line 75 of file transport6.py.

def get_model_text()
Definition: warehouse.py:16
GAMS Development Corp.
GAMS Software GmbH

General Information and Sales
U.S. (+1) 202 342-0180
Europe: (+49) 221 949-9170