A Survey of Adaptive Multi-Agent Networks and Their Applications in Smart Cities