transport8 Namespace Reference

Functions

def get_model_text ()
 
def scen_solve (workspace, checkpoint, bmult_list, list_lock, io_lock)
 

Variables

 ws = GamsWorkspace(system_directory = sys.argv[1])
 
 cp = ws.add_checkpoint()
 
 t8 = ws.add_job_from_string(get_model_text())
 
 checkpoint
 
list bmult_list = [ 1.3, 1.2, 1.1, 1.0, 0.9, 0.8, 0.7, 0.6 ]
 
 list_lock = threading.Lock()
 
 io_lock = threading.Lock()
 
int nr_workers = 2
 
dictionary threads = {}
 
 target
 
 scen_solve
 
 args
 

Function Documentation

◆ get_model_text()

def transport8.get_model_text ( )

Definition at line 14 of file transport8.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 
63 

◆ scen_solve()

def transport8.scen_solve (   workspace,
  checkpoint,
  bmult_list,
  list_lock,
  io_lock 
)

Definition at line 64 of file transport8.py.

References scen_solve.

Variable Documentation

◆ args

transport8.args

Definition at line 117 of file transport8.py.

◆ bmult_list

list transport8.bmult_list = [ 1.3, 1.2, 1.1, 1.0, 0.9, 0.8, 0.7, 0.6 ]

Definition at line 107 of file transport8.py.

◆ checkpoint

transport8.checkpoint

Definition at line 105 of file transport8.py.

◆ cp

transport8.cp = ws.add_checkpoint()

Definition at line 101 of file transport8.py.

◆ io_lock

transport8.io_lock = threading.Lock()

Definition at line 111 of file transport8.py.

◆ list_lock

transport8.list_lock = threading.Lock()

Definition at line 110 of file transport8.py.

◆ nr_workers

int transport8.nr_workers = 2

Definition at line 114 of file transport8.py.

◆ scen_solve

transport8.scen_solve

Definition at line 117 of file transport8.py.

Referenced by scen_solve().

◆ t8

transport8.t8 = ws.add_job_from_string(get_model_text())

Definition at line 104 of file transport8.py.

◆ target

transport8.target

Definition at line 117 of file transport8.py.

◆ threads

dictionary transport8.threads = {}

Definition at line 115 of file transport8.py.

◆ ws

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

Definition at line 97 of file transport8.py.

def get_model_text()
Definition: warehouse.py:16