# Human and Environmental Factors Analysis in Traffic Using Agent-Based Simulation
## 3 Materials and Methods
### Agent-Based Simulation Model  
The objective of the simulation is to leverage the autonomous and proactive nature of intelligent agents to mimic the actions of road users. The following list briefly describes the factors modeled in the simulation that potentially influence the agents:  
* Pavement condition: Pavement deterioration, the presence of potholes and accumulated precipitation generate increasing capacity restrictions and increase congestion [7]. Wet roads also become dangerous even if they do not have potholes, as rain may cause vehicles to slide and thus collide. * Ambient sensation: Rain, humidity and fog affect the driver's visibility conditions, and windshields blur internally and make it difficult to detect vehicles and people on the road. Pneumatic tires lose adherence and the wheel slip on the water with little contact with the pavement [34]. The extreme heat also makes drivers feel uncomfortable. * Animals on the road: There are numerous homeless animals that are run over or injured by vehicles. For drivers, it is also a danger because when trying to save these animals, they realize abrupt and hurried turns that can end in a collapse or an accident [35]. * Lane overtaking: This phenomenon occurs when a vehicle, either by driver's rush, provocation or recklessness, tries to pass in front of the vehicle preceding it on the road. This maneuver, if performed incorrectly, can cause accidents [36]. * Vehicle characteristics: The color, size and technical condition of the vehicle influence the driver's actions on the road. In addition, damage or breakage on the road would cause an exceptional waiting situation, until the vehicle is fixed or trailed [37]. * Person characteristics: Age, gender, disabilities, years of driving experience, mood, stress, sobriety and driving comfort of a person determine their decisions on the road [3; 38]. For every execution of the simulation, all these factors will be present, varying only in the obtaining of reports, where statistics of those selected for evaluation will be shown. Byincluding all these factors the state space of the simulation increases. For this reason, the values associated with each factor are treated in a discretized form, which minimizes the number of possible combinations. However, it is necessary to evaluate them because this combination of factors was not found in the literature reviewed. The presented simulation supports the representation of all the described factors in maps with a finite number of intersections. The simulation represents each actor in traffic as an agent. Road users and the above-mentioned time-varying factors are modeled. In the simulation, there are static agents, which are part of the environment and provide information to other agents for their operation, such as the map and the queuing model. Other agents also belong to the environment but have variable behavior in the simulation, such as the pavement, the weather and the traffic lights. Finally, there are the agents that model the people including the vehicle, the driver and the pedestrians. A description of how each non-static agent performs is given below:  
* Traffic light agent: Traffic lights work as simple reactive agents. They wait until a light has timed out and then activate the next light. There will be a traffic light phase for each access road to the traffic light, and each phase will have a set of available exit roads [4]. Traffic lights are the most hierarchical signals in the simulation. * Driver agent: Drivers are created randomly based on values for age, gender, experience on the road (years of driving experience), mood and a level of distraction, which may influence the behavior of the driving vehicle. The age and experience can determine their corresponding \"Risk Level\", which is used to establish the violation and accident probabilities of those drivers [39]. * Vehicle agent: The vehicles trace their trajectory from their arrival to the destination using [PERSON]'s algorithm [40].