Machine now releases the currentOperator if it is not in its skillSet for the following operation

parent b364746d
...@@ -695,6 +695,20 @@ class Machine(CoreObject): ...@@ -695,6 +695,20 @@ class Machine(CoreObject):
#=================================================================== #===================================================================
if self.shouldYield(operationTypes={"Setup":1,"Load":1,"Processing":0},methods={'isOperated':1}): if self.shouldYield(operationTypes={"Setup":1,"Load":1,"Processing":0},methods={'isOperated':1}):
yield self.env.process(self.release()) yield self.env.process(self.release())
elif (self.currentOperator):
if self.currentOperator.skillDict:
if not self.id in self.currentOperator.skillDict["process"]:
yield self.env.process(self.release())
#===================================================================
# # request a resource if it is not already assigned an Operator
#===================================================================
if self.shouldYield(operationTypes={"Processing":1}, methods={"isOperated":0}):
self.timeWaitForOperatorStarted = self.env.now
yield self.env.process(self.request())
self.timeWaitForOperatorEnded = self.env.now
self.operatorWaitTimeCurrentEntity += self.timeWaitForOperatorEnded-self.timeWaitForOperatorStarted
#=================================================================== #===================================================================
#=================================================================== #===================================================================
......
...@@ -314,7 +314,9 @@ class Router(ObjectInterruption): ...@@ -314,7 +314,9 @@ class Router(ObjectInterruption):
# XXX not generic enough - find an other way to initiate skilledRouter and incorporate also setup and load # XXX not generic enough - find an other way to initiate skilledRouter and incorporate also setup and load
if candidateOperator.skillDict: if candidateOperator.skillDict:
if (station.id in candidateOperator.skillDict["process"] and station in self.pendingMachines) or\ if (station.id in candidateOperator.skillDict["process"] and station in self.pendingMachines) or\
(station.id in candidateOperator.skillDict["setup"] and station in candidateMachines): (station.id in candidateOperator.skillDict["setup"] and station in candidateMachines) or\
((station.id in candidateOperator.skillDict["process"] and station in candidateMachines) and \
not station.getActiveObjectQueue()):
if not station in candidateOperator.candidateStations: if not station in candidateOperator.candidateStations:
candidateOperator.candidateStations.append(station) candidateOperator.candidateStations.append(station)
else: else:
......
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