I am using SimPy for a time-based simulation.
I have a Messager process which listens for a specific event, and returns the parameters of that event when it occurs:
class Messager(Process):
def __init__(self):
Process.__init__(self,'messager')
def monitor(self):
while True:
yield waitevent, self, messageEvent
print messageEvent.signalparam
messager = Messager()
activate(messager,messager.monitor())
this works fine. However, in reality there is more than one Event which should be handled by the Messager, and I want the Messager to return the signalparam for the causative Event in a list of events:
messageEvents = [Event1,Event2,Event3]
class Messager(Process):
def __init__(self):
Process.__init__(self,'messager')
def monitor(self):
while True:
yield waitevent, self, messageEvents
.....
how do I access the signalparam of the Event which has occurred?