Agent-based simulations of patterns for self-adaptive systems