Commit 7455798f authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

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

parent aae5d3c1
......@@ -694,8 +694,22 @@ class Machine(CoreObject):
# # release a resource at the end of setup
#===================================================================
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):
# XXX not generic enough - find an other way to initiate skilledRouter and incorporate also setup and load
if candidateOperator.skillDict:
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:
candidateOperator.candidateStations.append(station)
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