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

new Machine methods to update and return the processing/load/setupTime dictionaries

Conflicts:
	dream/simulation/Machine.py
parent c7866439
......@@ -46,38 +46,54 @@ from RandomNumberGenerator import RandomNumberGenerator
class Machine(CoreObject):
family='Server'
# =======================================================================
# initialise the id the capacity, of the resource and the distribution
# =======================================================================
def __init__(self, id, name, capacity=1, processingTime=None,
repairman='None',\
operatorPool='None',operationType='None',\
setupTime=None, loadTime=None,
preemption={},
canDeliverOnInterruption=False, **kw):
self.type="Machine" #String that shows the type of object
CoreObject.__init__(self, id, name)
from Globals import G
def getProcessingTime(self,processingTime):
'''returns the processingTime dictionary updated'''
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'])
return processingTime
def getSetupTime(self,setupTime):
'''returns the setupTime dictionary updated'''
if not setupTime:
setupTime = { 'distributionType': 'Fixed',
'mean': 1, }
if setupTime['distributionType'] == 'Normal' and\
setupTime.get('max', None) is None:
setupTime['max'] = float(setupTime['mean']) + 5 * float(setupTime['stdev'])
return setupTime
def getLoadTime(self,loadTime):
'''returns the loadTime dictionary updated'''
if not loadTime:
loadTime = { 'distributionType': 'Fixed',
'mean': 1, }
if loadTime['distributionType'] == 'Normal' and\
loadTime.get('max', None) is None:
loadTime['max'] = float(loadTime['mean']) + 5 * float(loadTime['stdev'])
return loadTime
# =======================================================================
# initialise the id the capacity, of the resource and the distribution
# =======================================================================
def __init__(self, id, name, capacity=1, processingTime=None,
repairman='None',\
operatorPool='None',operationType='None',\
setupTime=None, loadTime=None,
preemption={},
canDeliverOnInterruption=False, **kw):
self.type="Machine" #String that shows the type of object
CoreObject.__init__(self, id, name)
from Globals import G
processingTime=self.getProcessingTime(processingTime)
setupTime=self.getSetupTime(setupTime)
loadTime=self.getLoadTime(loadTime)
# holds the capacity of the machine
self.capacity=capacity
......
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