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,18 +187,22 @@ class Router(ObjectInterruption):
# print 'router will assign', operator.id, 'to', operator.candidateStation.id
#=======================================================
operator.assignTo(operator.candidateStation)
self.toBeSignalled.append(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)
self.toBeSignalled.append(operator.candidateEntity.currentStation)
if not operator.candidateEntity.currentStation in self.toBeSignalled:
self.toBeSignalled.append(operator.candidateEntity.currentStation)
#===================================================================
# # testing
# print 'router found objects to be signalled'
......@@ -591,7 +595,7 @@ class Router(ObjectInterruption):
for operator in self.candidateOperators:
if operator.candidateStation in conflictingStations:
conflictingOperators.append(operator)
self.conflictingOperators=conflictingOperators
self.conflictingOperators=conflictingOperators
# keep the sorting provided by the queues if there is conflict between operators
conflictingGroup=[] # list that holds the operators that have the same recipient
if not self.sorting and self.conflictingOperators:
......@@ -680,7 +684,7 @@ class Router(ObjectInterruption):
conflictingOperators.append(operator)
elif operator.candidateEntity.candidateReceiver in [x.candidateReceiver for x in conflinctingEntities]:
conflictingOperators.append(operator)
self.conflictingOperators=conflictingOperators
self.conflictingOperators=conflictingOperators
# keep the sorting provided by the queues if there is conflict between operators
conflictingGroup=[] # list that holds the operators that have the same recipient
if not self.sorting and self.conflictingOperators:
......
......@@ -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