Loading...
Searching...
No Matches

Pulic Methods

def __init__ (self, system_directory=None)
 
def solve (self, bmult, lock)
 

Static Public Attributes

str GAMS_MODEL
 

Protected Attributes

 _ws
 

Detailed Description

Definition at line 12 of file transport14.py.

Constructors

◆ __init__()

def transport14.Optimizer.__init__ (   self,
  system_directory = None 
)

Definition at line 13 of file transport14.py.

13 def __init__(self, system_directory=None):
14 self._ws = GamsWorkspace(system_directory=system_directory)
15

Methods

◆ solve()

def transport14.Optimizer.solve (   self,
  bmult,
  lock 
)

Definition at line 16 of file transport14.py.

16 def solve(self, bmult, lock):
17 lock.acquire()
18 db = self._ws.add_database()
19 lock.release()
20 f = db.add_parameter("f", 0, "freight in dollars per case per thousand miles")
21 f.add_record().value = 90 * bmult
22 job = self._ws.add_job_from_string(Optimizer.GAMS_MODEL)
23 opt = self._ws.add_options()
24 opt.defines["gdxincname"] = db.name
25 job.run(opt, databases=db)
26 return job.out_db["z"].first_record().level
27

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

Member Data Documentation

◆ _ws

transport14.Optimizer._ws
protected

Definition at line 14 of file transport14.py.

Referenced by cutstock_class.Cutstock.run(), and transport14.Optimizer.solve().

◆ GAMS_MODEL

str transport14.Optimizer.GAMS_MODEL
static

Definition at line 28 of file transport14.py.