Commit 34210375 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Ioannis Papagiannopoulos

objects updated to read distributions newstyle

parent 7b9ab64a
......@@ -55,23 +55,14 @@ class Assembly(CoreObject):
self.Working=[]
self.Blockage=[]
# if input is given in a dictionary
if inputsDict:
CoreObject.__init__(self, inputsDict=inputsDict)
# else read the separate ones
else:
if not processingTime:
processingTime = {'distributionType': 'Fixed',
'mean': 0,
'stdev': 0,
'min': 0,
}
if processingTime['distributionType'] == 'Normal' and\
processingTime.get('max', None) is None:
processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])
processingTime = {'Fixed':{'mean': 0 }}
if 'Normal' in processingTime.keys() and\
processingTime['Normal'].get('max', None) is None:
processingTime['Normal']['max'] = float(processingTime['Normal']['mean']) + 5 * float(processingTime['Normal']['stdev'])
CoreObject.__init__(self, id, name)
self.rng=RandomNumberGenerator(self, **processingTime)
self.rng=RandomNumberGenerator(self, processingTime)
# ============================== variable that is used for the loading of machines =============
self.exitAssignedToReceiver = False # by default the objects are not blocked
......
......@@ -50,18 +50,17 @@ class BatchDecomposition(CoreObject):
self.type="BatchDecomposition" #String that shows the type of object
if not processingTime:
processingTime = { 'distributionType': 'Fixed',
'mean': 1, }
if processingTime['distributionType'] == 'Normal' and\
processingTime.get('max', None) is None:
processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])
processingTime = {'Fixed':{'mean': 0 }}
if 'Normal' in processingTime.keys() and\
processingTime['Normal'].get('max', None) is None:
processingTime['Normal']['max'] = float(processingTime['Normal']['mean']) + 5 * float(processingTime['Normal']['stdev'])
# holds the capacity of the object
self.numberOfSubBatches=int(numberOfSubBatches)
# sets the operator resource of the Machine
self.operator=operator
# Sets the attributes of the processing (and failure) time(s)
self.rng=RandomNumberGenerator(self, **processingTime)
self.rng=RandomNumberGenerator(self, processingTime)
from Globals import G
G.BatchDecompositionList.append(self)
......
......@@ -49,18 +49,17 @@ class BatchReassembly(CoreObject):
CoreObject.__init__(self,id, name)
self.type="BatchRassembly" #String that shows the type of object
if not processingTime:
processingTime = { 'distributionType': 'Fixed',
'mean': 1, }
if processingTime['distributionType'] == 'Normal' and\
processingTime.get('max', None) is None:
processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])
processingTime = {'Fixed':{'mean': 0 }}
if 'Normal' in processingTime.keys() and\
processingTime['Normal'].get('max', None) is None:
processingTime['Normal']['max'] = float(processingTime['Normal']['mean']) + 5 * float(processingTime['Normal']['stdev'])
# holds the capacity of the object
self.numberOfSubBatches=numberOfSubBatches
# sets the operator resource of the Machine
self.operator=operator
# Sets the attributes of the processing (and failure) time(s)
self.rng=RandomNumberGenerator(self, **processingTime)
self.rng=RandomNumberGenerator(self, processingTime)
from Globals import G
G.BatchReassemblyList.append(self)
# flag to show if the objects outputs results
......
......@@ -31,10 +31,10 @@ import simpy
from RandomNumberGenerator import RandomNumberGenerator
class BatchSource(Source):
def __init__(self, id, name, interarrivalTime=None,
def __init__(self, id, name, interArrivalTime=None,
entity='Dream.Batch', batchNumberOfUnits=1, **kw):
Source.__init__(self, id=id, name=name,
interarrivalTime=interarrivalTime, entity=entity)
interArrivalTime=interArrivalTime, entity=entity)
self.numberOfUnits = int(batchNumberOfUnits)
from Globals import G
G.BatchSourceList.append(self)
......
......@@ -67,16 +67,12 @@ class Dismantle(CoreObject):
CoreObject.__init__(self, id, name)
from Globals import G
if not processingTime:
processingTime = {'distributionType': 'Fixed',
'mean': 0,
'stdev': 0,
'min': 0,
}
if processingTime['distributionType'] == 'Normal' and\
processingTime.get('max', None) is None:
processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])
self.rng=RandomNumberGenerator(self, **processingTime)
processingTime = {'Fixed':{'mean': 0 }}
if 'Normal' in processingTime.keys() and\
processingTime['Normal'].get('max', None) is None:
processingTime['Normal']['max'] = float(processingTime['Normal']['mean']) + 5 * float(processingTime['Normal']['stdev'])
self.rng=RandomNumberGenerator(self, processingTime)
#===========================================================================
# the initialize method
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment