signalReceiver of QueueManagedJob now sorts for the operator assigned to the...

signalReceiver of QueueManagedJob now sorts for the operator assigned to the Receiver the Queue before signalling
parent eb711b48
......@@ -423,7 +423,7 @@ class CoreObject(Process):
activeObject.giver.receiver=activeObject
#===================================================================
# # TESTING
# print now(), self.id,' '*50, 'signaling giver', self.giver.id
# print now(), self.id,' '*50, 'signalling giver', self.giver.id
#===================================================================
activeObject.giver.canDispose.signal(activeObject)
return True
......
......@@ -187,17 +187,21 @@ class Router(ObjectInterruption):
# print 'router will assign', operator.id, 'to', operator.candidateStation.id
#=======================================================
operator.assignTo(operator.candidateStation)
if not operator.candidateStation in self.toBeSignalled:
self.toBeSignalled.append(operator.candidateStation)
#------------------------------------------------------------------------------
else:
# and if the priorityObject is indeed pending
if (operator.candidateEntity.currentStation in self.pendingObjects) and (not operator in self.conflictingOperators):
if (operator.candidateEntity.currentStation in self.pendingObjects)\
and (not operator in self.conflictingOperators)\
and operator.candidateEntity.candidateReceiver:
# assign an operator to the priorityObject
#=======================================================
# # testing
# print 'router will assign', operator.id, 'to', operator.candidateEntity.candidateReceiver.id
#=======================================================
operator.assignTo(operator.candidateEntity.candidateReceiver)
if not operator.candidateEntity.currentStation in self.toBeSignalled:
self.toBeSignalled.append(operator.candidateEntity.currentStation)
#===================================================================
# # testing
......
......@@ -124,6 +124,14 @@ class QueueManagedJob(QueueJobShop):
return False
receiver=activeObject.selectReceiver(possibleReceivers)
receiversGiver=activeObject
#------------------------------------------------------------------------------
# TODO: if the receiver is already assigned an operator then the giver should sort for that manager
from Globals import G
for operator in G.OperatorsList:
if operator.isAssignedTo()==receiver:
activeObject.sortEntitiesForOperator(operator)
break
#------------------------------------------------------------------------------
# if an operator is not assigned to the receiver then do not signal the receiver but the Router
# TODO: identifyEntityToGet needs giver defined but here is not yet defined for Machines and machineJobShops
try:
......
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