Commit a8ff39e7 authored by Georgios Dagkakis's avatar Georgios Dagkakis

cleanups

parent 82815e3c
...@@ -83,7 +83,8 @@ class CoreObject(ManPyObject): ...@@ -83,7 +83,8 @@ class CoreObject(ManPyObject):
"preemptQueue":0, "preemptQueue":0,
"entityRemoved":0, "entityRemoved":0,
"entityCreated":0, "entityCreated":0,
"moveEnd":0 "moveEnd":0,
"processOperatorUnavailable":0
} }
def initialize(self): def initialize(self):
......
...@@ -181,7 +181,6 @@ class Machine(CoreObject): ...@@ -181,7 +181,6 @@ class Machine(CoreObject):
self.expectedSignals['initialWIP']=1 self.expectedSignals['initialWIP']=1
# events about the availability of process operator # events about the availability of process operator
# TODO group those operator relate events # TODO group those operator relate events
self.processOperatorAvailable=self.env.event()
self.processOperatorUnavailable=self.env.event() self.processOperatorUnavailable=self.env.event()
@staticmethod @staticmethod
...@@ -217,12 +216,6 @@ class Machine(CoreObject): ...@@ -217,12 +216,6 @@ class Machine(CoreObject):
loadTime['max'] = float(loadTime['mean']) + 5 * float(loadTime['stdev']) loadTime['max'] = float(loadTime['mean']) + 5 * float(loadTime['stdev'])
return loadTime return loadTime
# events about the availability of process operator
# TODO group those operator relate events
self.processOperatorAvailable=self.env.event()
self.processOperatorUnavailable=self.env.event()
#=========================================================================== #===========================================================================
# create an operatorPool if needed # create an operatorPool if needed
#=========================================================================== #===========================================================================
...@@ -610,6 +603,7 @@ class Machine(CoreObject): ...@@ -610,6 +603,7 @@ class Machine(CoreObject):
while processingNotFinished: while processingNotFinished:
self.expectedSignals['interruptionStart']=1 self.expectedSignals['interruptionStart']=1
self.expectedSignals['preemptQueue']=1 self.expectedSignals['preemptQueue']=1
self.expectedSignals['processOperatorUnavailable']=1
# timeLastProcessingStarted : dummy variable to keep track of the time that the processing starts after # timeLastProcessingStarted : dummy variable to keep track of the time that the processing starts after
# every interruption # every interruption
self.timeLastProcessingStarted=self.env.now self.timeLastProcessingStarted=self.env.now
...@@ -1181,7 +1175,7 @@ class Machine(CoreObject): ...@@ -1181,7 +1175,7 @@ class Machine(CoreObject):
if not self.currentOperator.onShift: if not self.currentOperator.onShift:
self.currentOperator.timeLastShiftEnded=self.env.now self.currentOperator.timeLastShiftEnded=self.env.now
self.currentOperator.unAssign() # set the flag operatorAssignedTo to None self.currentOperator.unAssign() # set the flag operatorAssignedTo to None
self.outputTrace(self.currentOperator.objName, "released from "+ self.objName) self.outputTrace(self.currentOperator.name, "released from "+ self.objName)
# XXX in case of skilled operators which stay at the same station should that change # XXX in case of skilled operators which stay at the same station should that change
elif not self.checkForDedicatedOperators(): elif not self.checkForDedicatedOperators():
self.currentOperator.unAssign() # set the flag operatorAssignedTo to None self.currentOperator.unAssign() # set the flag operatorAssignedTo to None
......
...@@ -151,7 +151,7 @@ class Broker(ObjectInterruption): ...@@ -151,7 +151,7 @@ class Broker(ObjectInterruption):
self.timeWaitForOperatorStarted = 0 self.timeWaitForOperatorStarted = 0
# update the time that the operation started # update the time that the operation started
self.timeOperationStarted = self.env.now self.timeOperationStarted = self.env.now
self.victim.outputTrace(self.victim.currentOperator.objName, "started work in "+ self.victim.objName) self.victim.outputTrace(self.victim.currentOperator.name, "started work in "+ self.victim.objName)
self.victim.currentOperator.timeLastOperationStarted=self.env.now#() self.victim.currentOperator.timeLastOperationStarted=self.env.now#()
# signal the machine that an operator is reserved # signal the machine that an operator is reserved
if self.victim.expectedSignals['brokerIsSet']: if self.victim.expectedSignals['brokerIsSet']:
......
...@@ -38,8 +38,7 @@ class Operator(ObjectResource): ...@@ -38,8 +38,7 @@ class Operator(ObjectResource):
family='Operator' family='Operator'
def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skills=[], available=True,**kw): def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skills=[], available=True,**kw):
ObjectResource.__init__(self) ObjectResource.__init__(self,id=id, name=name)
self.id=id
self.objName=name self.objName=name
self.capacity=int(capacity) # repairman is an instance of resource self.capacity=int(capacity) # repairman is an instance of resource
self.type="Operator" self.type="Operator"
......
...@@ -131,6 +131,7 @@ class ShiftScheduler(ObjectInterruption): ...@@ -131,6 +131,7 @@ class ShiftScheduler(ObjectInterruption):
if station: if station:
if not self.endUnfinished and station.isProcessing: if not self.endUnfinished and station.isProcessing:
station.processOperatorUnavailable.succeed(self.env.now) station.processOperatorUnavailable.succeed(self.env.now)
station.expectedSignals['processOperatorUnavailable']=0
CoreObject.requestAllocation() CoreObject.requestAllocation()
# if the victim has interruptions that measure only the on-shift time, they have to be notified # if the victim has interruptions that measure only the on-shift time, they have to be notified
......
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