Commit 0f9e90fc authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

LineGenerationJSON modified to incorporate operated...

LineGenerationJSON modified to incorporate operated MachinePreemptive/MouldAssembly objects. Machine also releases operators in case of preemption.
parent d15a0098
This diff is collapsed.
......@@ -342,6 +342,13 @@ class Machine(CoreObject):
if (len(self.getActiveObjectQueue())==0 and self.shouldPreempt):
self.shouldPreempt=False
self.totalWorkingTime+=now()-(self.timeLastEntityEntered)
# TODO: Should release operator here
# =============== release resource in case of preemption
if (self.operatorPool!='None')\
and any(type=="Processing" for type in self.multOperationTypeList)\
and not interruption:
self.releaseOperator()
yield waituntil,self,self.broker.brokerIsSet
continue
# output to trace that the processing in the Machine self.objName ended
......
......@@ -33,9 +33,16 @@ from SimPy.Simulation import reactivate, now
class MachinePreemptive(MachineJobShop):
def __init__(self, id, name, capacity=1, distribution='Fixed', mean=1, stdev=0, min=0, max=10,\
failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None', resetOnPreemption=True):
failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
operatorPool='None',operationType='None',\
loadDistribution="No",loadMean=0, loadStdev=0, loadMin=0, loadMax=10,\
setupDistribution="No",setupMean=0, setupStdev=0, setupMin=0, setupMax=10,\
resetOnPreemption=True):
MachineJobShop.__init__(self, id, name, capacity, distribution, mean, stdev, min, max,\
failureDistribution, MTTF, MTTR, availability, repairman)
failureDistribution, MTTF, MTTR, availability, repairman,\
operatorPool,operationType,\
loadDistribution,loadMean, loadStdev, loadMin, loadMax,\
setupDistribution,setupMean, setupStdev, setupMin, setupMax)
self.resetOnPreemption=resetOnPreemption #flag that shows if the processing time should be reset or not
def getEntity(self):
......
......@@ -53,6 +53,7 @@ class OperatorPreemptive(Operator):
if len(activeResourceQueue)==0:
return True
# read the station currently operated by the operator
# TODO: the victim of the operator is the Broker of the Machine. Modify to preempt the machine and not the broker
victim=activeResourceQueue[0]
# read its activeQ
victimQueue=victim.getActiveObjectQueue()
......
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