CoreObject prin comments added

parent 699be5b0
...@@ -323,9 +323,10 @@ class CoreObject(Process): ...@@ -323,9 +323,10 @@ class CoreObject(Process):
possibleReceivers=[] possibleReceivers=[]
for object in [x for x in self.next if x.canAccept(activeObject)]: for object in [x for x in self.next if x.canAccept(activeObject)]:
possibleReceivers.append(object) possibleReceivers.append(object)
# print now(), self.id,'possibleReceivers',[str(x.id) for x in possibleReceivers]
if possibleReceivers: if possibleReceivers:
activeObject.receiver=activeObject.selectReceiver(possibleReceivers) activeObject.receiver=activeObject.selectReceiver(possibleReceivers)
activeObject.receiver.giver=activeObject activeObject.receiver.giver=activeObject
# perform the checks that canAcceptAndIsRequested used to perform and update activeCallersList or assignExit and operatorPool # perform the checks that canAcceptAndIsRequested used to perform and update activeCallersList or assignExit and operatorPool
while not activeObject.receiver.canAcceptAndIsRequested(): while not activeObject.receiver.canAcceptAndIsRequested():
possibleReceivers.remove(activeObject.receiver) possibleReceivers.remove(activeObject.receiver)
...@@ -371,6 +372,7 @@ class CoreObject(Process): ...@@ -371,6 +372,7 @@ class CoreObject(Process):
for object in [x for x in activeObject.previous if(not x is activeObject)]: for object in [x for x in activeObject.previous if(not x is activeObject)]:
if object.haveToDispose(activeObject): if object.haveToDispose(activeObject):
possibleGivers.append(object) possibleGivers.append(object)
# print 'possibleGivers:', [str(x.id) for x in possibleGivers]
if possibleGivers: if possibleGivers:
activeObject.giver=activeObject.selectGiver(possibleGivers) activeObject.giver=activeObject.selectGiver(possibleGivers)
activeObject.giver.receiver=activeObject activeObject.giver.receiver=activeObject
...@@ -578,12 +580,14 @@ class CoreObject(Process): ...@@ -578,12 +580,14 @@ class CoreObject(Process):
# assign Exit of the object # assign Exit of the object
# ======================================================================= # =======================================================================
def assignExitTo(self): def assignExitTo(self):
# print self.id, 'assignExit'
self.exitAssignedToReceiver = self.receiver self.exitAssignedToReceiver = self.receiver
# ======================================================================= # =======================================================================
# unblock the object # unblock the object
# ======================================================================= # =======================================================================
def unAssignExit(self): def unAssignExit(self):
# print now(),self.id, 'unassignExit'
self.exitAssignedToReceiver = None self.exitAssignedToReceiver = None
# ======================================================================= # =======================================================================
......
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