Commit 601fb807 authored by Georgios Dagkakis's avatar Georgios Dagkakis

assignment of exit moved in CoreObject.signalReceiver

parent f3fd097a
......@@ -496,6 +496,8 @@ class CoreObject(ManPyObject):
self.printTrace(self.id, signalReceiver=self.receiver.id)
# assign the entry of the receiver
self.receiver.assignEntryTo()
# assign the exit of the current object to the receiver
self.assignExitTo(self.receiver)
if self.receiver.expectedSignals['isRequested']:
self.sendSignal(receiver=self.receiver, signal=self.receiver.isRequested)
return True
......
......@@ -1010,9 +1010,8 @@ class Machine(CoreObject):
if giverObject.haveToDispose(self):
if self.checkOperator()\
and self.checkIfActive() and len(activeObjectQueue)<self.capacity:
if not giverObject.exitIsAssignedTo():
giverObject.assignExitTo(self)
elif giverObject.exitIsAssignedTo()!=self:
# if the exit of the object is already assigned somewhere else, return false
if giverObject.exitIsAssignedTo() and giverObject.exitIsAssignedTo()!=self:
return False
return True
else:
......@@ -1023,9 +1022,8 @@ class Machine(CoreObject):
# operation is assigned
if self.checkIfActive() and len(activeObjectQueue)<self.capacity\
and giverObject.haveToDispose(self):
if not giverObject.exitIsAssignedTo():
giverObject.assignExitTo(self)
elif giverObject.exitIsAssignedTo()!=self:
# if the exit of the object is already assigned somewhere else, return false
if giverObject.exitIsAssignedTo() and giverObject.exitIsAssignedTo()!=self:
return False
return True
......
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