Commit 65f96937 authored by Georgios Dagkakis's avatar Georgios Dagkakis

better implementation of Machine.releaseOperator

parent 9e42059a
...@@ -1149,16 +1149,16 @@ class Machine(CoreObject): ...@@ -1149,16 +1149,16 @@ class Machine(CoreObject):
# prepare the machine to be released # prepare the machine to be released
# ======================================================================= # =======================================================================
def releaseOperator(self): def releaseOperator(self):
self.outputTrace(self.currentOperator.objName, "released from "+ self.objName) # this checks if the operator is working on the last element.
# set the flag operatorAssignedTo to None # If yes the time that he was set off-shift should be updated
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)
# 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
# TODO I think this control should be moved before the method is called elif not self.checkForDedicatedOperators():
if not self.checkForDedicatedOperators(): self.currentOperator.unAssign() # set the flag operatorAssignedTo to None
self.currentOperator.unAssign() self.outputTrace(self.currentOperator.objName, "released from "+ self.objName)
# this checks if the operator is working on the last element.
# If yes the time that he was set off-shift should be updated
if not self.currentOperator.onShift:
self.currentOperator.timeLastShiftEnded=self.env.now
self.broker.invoke() self.broker.invoke()
self.toBeOperated = False self.toBeOperated = False
......
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