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): ...@@ -423,7 +423,7 @@ class CoreObject(Process):
activeObject.giver.receiver=activeObject activeObject.giver.receiver=activeObject
#=================================================================== #===================================================================
# # TESTING # # 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) activeObject.giver.canDispose.signal(activeObject)
return True return True
......
...@@ -187,17 +187,21 @@ class Router(ObjectInterruption): ...@@ -187,17 +187,21 @@ class Router(ObjectInterruption):
# print 'router will assign', operator.id, 'to', operator.candidateStation.id # print 'router will assign', operator.id, 'to', operator.candidateStation.id
#======================================================= #=======================================================
operator.assignTo(operator.candidateStation) operator.assignTo(operator.candidateStation)
if not operator.candidateStation in self.toBeSignalled:
self.toBeSignalled.append(operator.candidateStation) self.toBeSignalled.append(operator.candidateStation)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
else: else:
# and if the priorityObject is indeed pending # 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 # assign an operator to the priorityObject
#======================================================= #=======================================================
# # testing # # testing
# print 'router will assign', operator.id, 'to', operator.candidateEntity.candidateReceiver.id # print 'router will assign', operator.id, 'to', operator.candidateEntity.candidateReceiver.id
#======================================================= #=======================================================
operator.assignTo(operator.candidateEntity.candidateReceiver) operator.assignTo(operator.candidateEntity.candidateReceiver)
if not operator.candidateEntity.currentStation in self.toBeSignalled:
self.toBeSignalled.append(operator.candidateEntity.currentStation) self.toBeSignalled.append(operator.candidateEntity.currentStation)
#=================================================================== #===================================================================
# # testing # # testing
......
...@@ -124,6 +124,14 @@ class QueueManagedJob(QueueJobShop): ...@@ -124,6 +124,14 @@ class QueueManagedJob(QueueJobShop):
return False return False
receiver=activeObject.selectReceiver(possibleReceivers) receiver=activeObject.selectReceiver(possibleReceivers)
receiversGiver=activeObject 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 # 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 # TODO: identifyEntityToGet needs giver defined but here is not yet defined for Machines and machineJobShops
try: 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