# Human and Environmental Factors Analysis in Traffic Using Agent-Based Simulation
## 3 Materials and Methods
### Agent-Based Simulation Model
These agents can collide, commit infractions and overtake other vehicle agents based on probabilities. They are driven by drivers, and the characteristics of these, combined with their color, size and technical conditions determine the probability of the events associated with them [39]. * Pedestrian agent: Pedestrians follow an established route when they are created. They may be generated from a vehicle and may have simple disabilities such as visual, motor or hearing impairments. Pedestrians have energy that is depleted as they walk. They can be chatting or talking while they walk [39]. * Pavement agent: The behavior is based on improving or worsening its ability to circulate vehicles. Before starting the simulation, an initial state is configured, which may change during the simulation. When drivers are about to drive on a road, the first step is to check its condition and then modify their speed to protect the vehicle from damage and breakage [7]. * Weather agent: The environmental conditions considered for the simulation are temperature, humidity, time of day and precipitation. The update of the observed variables is displayed by the environment at each step of the simulation and the vehicles are notified accordingly to moderate their speed considering the environmental state at each moment [7]. To represent the simulation model, the agents, their tasks, responsibilities and purposes, diagrams of the agent-oriented methodology, built with the INGENIAS software, IDK 2.7 [41; 42], are used. Figure 1 shows a static view of the agents and their respective responsibilities and purposes. A dynamic view of the agent-based model is shown in Figure 2. The static view places all agents within the model with their purposes and responsibilities. The dynamic view relates these agents, showing, in addition, all the tasks of the simulation with their responsible and participants. In addition to the described agents, there are other entities that represent the remaining signals on the road -shown in order of importance on the road-: Stop, Yield and Speed Control signals. These do not have any associated behavior, they are only placed on the road at the beginning of the simulation and the users must respond to them. The location of the signals is obtained from OpenStreetMap [43] or placed by the expert in charge of the simulation. Vehicles should only obey one signal at a time, as there is only one signal at each corner of the simulated map. To place a new signal on a corner that already has one, it can only be superior in type, eliminating the previous signal. From the previous descriptions, the following basic rules of the simulation model can be obtained. All rules are based on probabilities posted by traffic staff:  
* Vehicles proceed according to the status of the traffic light and other signals. * Vehicles may commit infractions. * Vehicles may overtake lanes. * Vehicles avoid obstacles. * Vehicles may break down while driving. * Vehicles behave according to the characteristics of their driver. * Vehicles behave according to the characteristics of the environment. * Vehicles behave according to the characteristics of the pavement. * There is a probability for pedestrians to stop and talk to other pedestrians. * There is a probability for pedestrians to black out due to lack of energy. * Disabled pedestrians will only cross the street at corners and with assistance. * There is a probability for vehicles to drop off passengers. * There is a probability for vehicles to pick up passengers. Figure 1: Static view of the agents present in the model: responsibilities and purposes.