A Scalable Agent-Based Smart Environment for Edge-Based Urban IoT Systems