Exploring the relationship between functional diversity and resilience in coral reef communities with an agent-based model