Broker now operates with events

parent 96b330f0
......@@ -318,8 +318,8 @@ class CoreObject(Process):
activeObject.receiver=activeObject.selectReceiver(possibleReceivers)
activeObject.receiver.giver=activeObject
#===================================================================
# TESTING
# print now(), self.id, 'signaling receiver', self.receiver.id
# # TESTING
# print now(), self.id,' '*50, 'signaling receiver', self.receiver.id
#===================================================================
activeObject.receiver.isRequested.signal(activeObject)
return True
......@@ -360,8 +360,8 @@ class CoreObject(Process):
activeObject.giver=activeObject.selectGiver(possibleGivers)
activeObject.giver.receiver=activeObject
#===================================================================
# TESTING
# print now(), self.id, 'signaling giver', self.giver.id
# # TESTING
# print now(), self.id,' '*50, 'signaling giver', self.giver.id
#===================================================================
activeObject.giver.canDispose.signal(activeObject)
return True
......
......@@ -53,29 +53,31 @@ class ObjectInterruption(Process):
# =======================================================================
# hand in the control to the objectIterruption.run
# to be called by the machine
# TODO: consider removing this method,
# signalling can be done via Machine request/releaseOperator
# =======================================================================
def invoke(self):
self.call=True
self.brokerIsCalled.signal(now())
# =======================================================================
# return control to the Machine.run
# =======================================================================
def exit(self):
self.call=False
# # =======================================================================
# # return control to the Machine.run
# # =======================================================================
# def exit(self):
# self.call=False
# =======================================================================
# call the objectInterruption
# filter for object interruption - yield waituntil isCalled
# =======================================================================
def isCalled(self):
return self.call
# # =======================================================================
# # call the objectInterruption
# # filter for object interruption - yield waituntil isCalled
# # =======================================================================
# def isCalled(self):
# return self.call
# =======================================================================
# the objectIterruption returns control to machine.Run
# filter for Machine - yield request/release operator
# =======================================================================
def isSet(self):
return not self.call
# # =======================================================================
# # the objectIterruption returns control to machine.Run
# # filter for Machine - yield request/release operator
# # =======================================================================
# def isSet(self):
# return not self.call
#===========================================================================
# outputs data to "output.xls"
......@@ -110,7 +112,7 @@ class ObjectInterruption(Process):
# reactivate the victim
#===========================================================================
def reactivateVictim(self):
self.victim.interruptionEnd.signal(self.victim)
self.victim.interruptionEnd.signal(now())
# reactivate(self.victim)
#===========================================================================
......
This diff is collapsed.
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