Vehicular travel which demands on the concurrent operations and parallel activities is increasing throughout the world, particularly in large urban areas. Most of the models introduced in the recent years are formulated using the language of cellular automata (CA). In this paper, to control urban traffic, we study the simulation and optimization of traffic light controllers in a city and present an adaptive fuzzy algorithm based on cellular automata properties. We have used CA for simulating transition function of density of vehicles. Although in the existent system environmental factors like priority of streets of intersection and width and length of streets are assumed equal and have no role in making decision for changing the status of traffic light, in real situations parameters like time during the entire day, density of the vehicles of the street, number of shopping centers, offices, malls that have plenty of clients, have determinant effects on amount of traffic of streets. To overcome these limitations we proposed a novel three leveled fuzzy system; at the first level priority of each street is computed momently based on fuzzy rules and regarding to environmental factors. At the second level real velocity of vehicles of every street is calculated at specific moment and at the third level by taking into account two parameters, priority of the street and amount of density behind the traffic light, decision for changing status of traffic light is done. Simulation results of our method underline efficiency and robustness of our approach in comparisons with best available global and adaptive strategies of traffic light control.