We used mesa, a python library along with others, to create a multiagent simulation simulating a cross intersection between traffic lights, cars, and pedestrians. We created two simulations in python and then used unity to simulate them. The first one had a normal traffic light that changed based on constant time or the number of steps. The second one introduced an intelligent traffic light that took into account the number of pedestrians and cars.
We wanted to show that by introducing a smart traffic light in this system; the mobility of an intersection can be made more efficient by at least 20% in time. By doing so, it can determine the most optimal crossing time based on the number of pedestrians and/or vehicles at crosswalks and intersections, respectively. We will be able to determine the percentage of efficiency by comparing our intelligent agent with a traffic light that controls the flow of both pedestrian and vehicular traffic at a constant time.
We succeded in making a smart traffic light that is 52% more time-efficient, since it is able to finish the same simulation with an equal number of cars and pedestrians in less steps.
- Mesa
- matplotlib
- numpy
- pandas
- C#


