In this article we present a strategy based on an evolutionary algorithm to calculate the real vehicle ows in cities according to data from sensors placed in the streets. We have worked with a map imported from OpenStreetMap into the SUMO traffic simulator so that the resulting scenarios can be used to perform different optimizations with the confidence of being able to work with a traffic distribution close to reality. We have compared the results of our algorithm to other competitors and achieved results that replicate the real traffic distribution with a precision higher than 90%.Universidad de Málaga. Campus de Excelencia Internacional Andalucía Tech. This research has been partially funded by project number 8.06/5.47.4142 in collaboration with the VSB-Technical University of Ostrava and Universidad de Málaga UMA/FEDER FC14-TIC36, programa de fortalecimiento de las capacidades de I+D+i en las universidades 2014-2015, de la Consejería de Economía, Innovación, Ciencia y Empleo, cofinanciado por el fondo europeo de desarrollo regional (FEDER). Also, partially funded by the Spanish MINECO project TIN2014-57341-R (http://moveon.lcc.uma.es). The authors would like to thank the FEDER of European Union for financial support via project Movilidad Inteligente: Wi-Fi, Rutas y Contaminación (maxCT) of the "Programa Operativo FEDER de Andalucía 2014-2020. We also thank all Agency of Public Works of Andalusia Regional Government staff and researchers for their dedication and professionalism. Daniel H. Stolfi is supported by a FPU grant (FPU13/00954) from the Spanish Ministry of Education, Culture and Sports