An Intelligent System for Traffic Control in Smart Cities