Adaptation to unexpected changes : where ecosystems and multi-agent systems meet