Loading...
Searching...
No Matches
cutstock_class.Cutstock Class Reference

Pulic Methods

def __init__ (self, system_directory)
 
def run (self, output=None)
 

Public Attributes

 opt
 
 widths
 
 raw_width
 
 demand
 
 width
 
 pat_rep
 

Protected Attributes

 _ws
 
 _cutstock_data
 
 _job
 
 _dbout
 

Detailed Description

Definition at line 130 of file cutstock_class.py.

Constructors

◆ __init__()

def cutstock_class.Cutstock.__init__ (   self,
  system_directory 
)

Definition at line 131 of file cutstock_class.py.

131 def __init__(self, system_directory):
132 self._ws = GamsWorkspace(system_directory=system_directory)
133 self.opt = self._ws.add_options()
134 self._cutstock_data = self._ws.add_database(in_model_name="gdxincname")
135
136 self.opt.solvelink = SolveLink.LoadLibrary
137 self.opt.defines["dbOut1"] = "dbOut1"
138
139 self.widths = self._cutstock_data.add_set("i", 1, "widths")
140 self.raw_width = self._cutstock_data.add_parameter("r", 0, "raw width")
141 self.demand = self._cutstock_data.add_parameter_dc("d", [self.widths], "demand")
142 self.width = self._cutstock_data.add_parameter_dc("w", [self.widths], "width")
143
144 self._job = self._ws.add_job_from_string(GAMS_MODEL)
145
146 self._dbout = None
147 self.pat_rep = None
148

Methods

◆ run()

def cutstock_class.Cutstock.run (   self,
  output = None 
)

Definition at line 149 of file cutstock_class.py.

149 def run(self, output=None):
150 self._job.run(self.opt, output=output, databases=self._cutstock_data)
151 self._dbout = self._ws.add_database_from_gdx(
152 self.opt.defines["dbOut1"] + ".gdx"
153 )
154 self.pat_rep = self._dbout.get_parameter("patrep")

References cutstock_class.Cutstock._cutstock_data, cutstock_class.Cutstock._dbout, cutstock_class.Cutstock._job, transport_class.Transport._job, cutstock_class.Cutstock._ws, transport14.Optimizer._ws, transport_class.Transport._ws, cutstock_class.Cutstock.opt, transport_class.Transport.opt, cutstock_class.Cutstock.pat_rep, and cutstock_class.Cutstock.run().

Referenced by cutstock_class.Cutstock.run().

Member Data Documentation

◆ _cutstock_data

cutstock_class.Cutstock._cutstock_data
protected

Definition at line 134 of file cutstock_class.py.

Referenced by cutstock_class.Cutstock.run().

◆ _dbout

cutstock_class.Cutstock._dbout
protected

Definition at line 146 of file cutstock_class.py.

Referenced by cutstock_class.Cutstock.run().

◆ _job

cutstock_class.Cutstock._job
protected

◆ _ws

cutstock_class.Cutstock._ws
protected

Definition at line 132 of file cutstock_class.py.

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

◆ demand

cutstock_class.Cutstock.demand

Definition at line 141 of file cutstock_class.py.

◆ opt

cutstock_class.Cutstock.opt

◆ pat_rep

cutstock_class.Cutstock.pat_rep

Definition at line 147 of file cutstock_class.py.

Referenced by cutstock_class.Cutstock.run().

◆ raw_width

cutstock_class.Cutstock.raw_width

Definition at line 140 of file cutstock_class.py.

◆ width

cutstock_class.Cutstock.width

Definition at line 142 of file cutstock_class.py.

◆ widths

cutstock_class.Cutstock.widths

Definition at line 139 of file cutstock_class.py.