transport_class.Transport Class Reference

Pulic Methods

def __init__ (self, ws)
 
def get_model_source (self)
 
def run (self, checkpoint=None, output=None)
 

Public Attributes

 opt
 
 i
 
 j
 
 a
 
 b
 
 d
 
 f
 
 x
 
 z
 

Detailed Description

Definition at line 10 of file transport_class.py.

Constructors

◆ __init__()

def transport_class.Transport.__init__ (   self,
  ws 
)

Definition at line 12 of file transport_class.py.

12 def __init__(self, ws):
13 
14  self._ws = ws
15  self.opt = ws.add_options()
16 
17  self._dbin1 = ws.add_database(in_model_name = "dbIn1")
18  self._dbin2 = ws.add_database(in_model_name = "dbIn2")
19 
20  self.opt.solvelink = SolveLink.LoadLibrary
21  self.opt.all_model_types = "Cplex"
22  self.opt.defines["dbOut1"] = "dbOut1"
23 
24  self.i = self._dbin1.add_set("i", 1, "canning plants")
25  self.j = self._dbin1.add_set("j", 1, "markets")
26  self.a = self._dbin1.add_parameter_dc("a", [self.i], "capacity of plant i in cases")
27  self.b = self._dbin1.add_parameter_dc("b", [self.j], "demand at market j in cases")
28  self.d = self._dbin1.add_parameter_dc("d", [self.i, self.j], "distance in thousands of miles")
29  self.f = self._dbin2.add_parameter("f", 0, "freight in dollars per case per thousand miles")
30  self.x = None
31  self.z = None
32 
33 
34 
35  self._job = ws.add_job_from_string(self.get_model_source())
36 

References cutstock_class.Cutstock._ws, and transport_class.Transport._ws.

Methods

◆ get_model_source()

def transport_class.Transport.get_model_source (   self)

Definition at line 37 of file transport_class.py.

◆ run()

Member Data Documentation

◆ a

transport_class.Transport.a

Definition at line 26 of file transport_class.py.

◆ b

transport_class.Transport.b

Definition at line 27 of file transport_class.py.

◆ d

transport_class.Transport.d

Definition at line 28 of file transport_class.py.

◆ f

transport_class.Transport.f

Definition at line 29 of file transport_class.py.

◆ i

transport_class.Transport.i

Definition at line 24 of file transport_class.py.

◆ j

transport_class.Transport.j

Definition at line 25 of file transport_class.py.

◆ opt

transport_class.Transport.opt

Definition at line 15 of file transport_class.py.

Referenced by transport_class.Transport.run().

◆ x

transport_class.Transport.x

Definition at line 30 of file transport_class.py.

Referenced by transport_class.Transport.run().

◆ z

transport_class.Transport.z

Definition at line 31 of file transport_class.py.

Referenced by transport_class.Transport.run().