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