Commit 82a06417 authored by Georgios Dagkakis's avatar Georgios Dagkakis

cleanups

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