1. function receive(message msg)

2. if (msg.time < tl) return causality error

3. if msg is a y-message

4. save the event of the msg in the outputData

5. tl = time of the message msg

6. end receive