###### Abstract
Tests were carried out in Malaga, Spain and a group of programs generated by four optimization algorithms were validated: PSO for traffic lights, differential evolution for traffic lights, random search and the SUMO cycle program generator. The tests were carried out taking into account the following factors. (1) Climate: the types of weather considered were rainy, thunderstorm, sunny, windy and cloudy. Weights were assigned to each of them taking into account the percentage of the days of the year that have these conditions. (2) Number of vehicles: the number of vehicles was established as a little or a lot. (3) Driver imperfection: this characteristic represents poor driving quality (low, medium or high). In many traffic situations, the driver makes a difference, which is why three levels of driving were defined. (4) Reaction time of the driver: time interval needed by the driver to perform an action. Three levels were considered (low, medium and fast). (5) Type of vehicle: two types of vehicles were taken into account (light and heavy). The weights were defined according to the information about the vehicles that operate in the city. [PERSON] used a multi objective evolutionary algorithm (MOEA) for the optimization of traffic signal control in the city of Montevideo in Uruguay for the programming of intelligent traffic lights with good results [14]. MOEA algorithms were combined with a microscopic traffic model to simulate the vehicular flow while simultaneously reducing pollutant emissions. Another approach is the one used by [PERSON] et al. [15], applying a predictive model with time delay used in conjunction with differential evolution techniques and GAs in an urban simulator reproduction of a city in BeloHorizonte, Brazil. They achieved a 47% reduction of the delay time of the vehicles with respect to the normal programming of the traffic systems. A study by [PERSON] and [PERSON] [16] of two neighborhoods of cities in South America, Jacinto Vera in Montevideo and the micro-center Posadas in Argentina (areas with very different topologies), performed tests of the programming of traffic light cycles with the objective of minimizing the waiting time of the vehicles and maximizing their speed. As a result, traffic flow was improved, reducing fuel consumption and therefore the emission of pollutants. They tested five metaheuristics and concluded that the one that produced the best results was differential evolution. The present paper proposes a method, referred to as the micro artificial immune system algorithm (MAIS), for the optimization of traffic cycle programming based on an artificial immune system micro-algorithm, and analyzes it on a real urban topology in a very important avenue of Mexico City (Avenida Insurgentes) using meta-heuristic techniques combined with simulation with the objective of improving the vehicular flow and reducing the emission of pollutants into the environment. The objective is to minimize the waiting time of the vehicles flowing in the network and maximize their speed. The results obtained improve the traffic flow by reducing waiting times and increasing the speed of the vehicles, favoring a decrease in fuel consumption and environmental pollution. The MAIS demonstrates that it improves not only the flow of the vehicles but also reduces pollution and fuel consumption. Our objective is to test MAIS as an option for the efficient programming of traffic lights, and verify whether it is equivalent to other similar algorithms and if it has some advantages. The MAIS algorithm was designed and configured in a unique way not used before by an artificial immune system with reduced population. The main contributions of this paper are as follows. 1. The proposed MAIS is the first to be used in a practical problem of this kind. 2. MAIS and PSO provide the best results, better than the other tested algorithms, namely, simulated annealing (SA), the genetic algorithm (GA), and differential evolution (DE). 3. The behavior of the MAIS is tested. 4.