Foundations of Multi-Agent Systems