Modeling Cooperation in Multi-Agent Communities