1. function receive(message msg)

2. when receive an initialization i-message with t = 0

3. initialize system’s states S

4. tl = 0

5. tn = ta(s)

6. when receive a collect @-message with t = tn

7. y = λ(s)

8. post (y)

9. when receive an internal *-message with tl <= t <= tn

10. if (t ≠ tn)

11. e = t - tl

12. s = δext(s, e, xb)

13. else if (t = tn) and (xb = Ø)

14. s = δint(s)

15. else if (t = tn) and (xb ≠ Ø)

16. s = δcon(s, xb)

17. tl = t

18. tn = tl + ta(s)

19. else if tn < t < tl return causality error

20. end receive