From real-time adaptation to social learning in robot ecosystems