# Human and Environmental Factors Analysis in Traffic Using Agent-Based Simulation
## 3 Materials and Methods
### Mathematical Model of Simulation Using Queuing System  
The waiting time of vehicles at signals is modeled using queuing theory, where the customers are the vehicles, and the service provided is the activation of the signal to allow them to pass [44]. A queuing system is denoted by \((A|B|C:D|E|F)\) representation. Table 1 shows the representation of the queuing systems used in our model, which is based on the analysis at [28]. Service distribution has two possible values as there are two types of stations: traffic lights and stop signs. Stop signs have exponential distribution [28], so the model for these stations will be \((M/M/s)\). Traffic lights follow a general distribution [45] and the model will be \((M/G/s)\). Table 2 shows the list of groups and parameters used by the model. It is also presented where each data set is obtained for the evaluation of the simulation and queuing \begin{table}
\begin{tabular}{c c c} \hline \hline
**Notation** & **Description** & **Values** \\ \hline A & Arrival distribution & Markovian (M) \\ B & Service distribution & Markovian (M)/General (G) \\ C & Number of servers & Lanes of the streets \\ D & Service discipline & FCFS (First Come, First Serve) \\ E & Maximum number of customers & Infinite \\ F & Customers source & Streets of the map \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Components of a queuing system and their representation in traffic. Figure 2: Dynamic view of the agents present in the model: relationships between agents, model tasks, responsible persons and participants. systems [44]. The results that are generated by the simulation are random, while those set by the analyst are based on his knowledge of the traffic in the area. All model parameters are configurable so that it is usable by traffic staff. They have the responsibility to set some parameters and will also have the possibility to edit the ones obtained from the providers. Figure 3 illustrates how the relationship between the parameters behaves from a bottom up view of the parameters. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter Group** & **Parameter Name** & **Parameters Provider** \\ \hline \multirow{4}{*}{Queuing Model} & Average arrival rate & \\  & Average service rate & \\  & Variance of service time & \\  & Utilization factor & \\ \hline \multirow{3}{*}{Map} & Street Type & \\  & Surface condition & OpenStreetMap 2  \\  & Width & \\  & Maximum Allowed Speed & \\ \hline \multirow{3}{*}{Vehicles} & Type & \\  & Technical condition & Set by traffic analyst \\  & Vehicle length & \\ \hline \multirow{3}{*}{People} & Age & \\  & Sex & \\  & Knowledge of the area & \\  & Years of experience & \\ \hline \multirow{3}{*}{Weather} & Temperature & \\  & Humidity & OpenWeatherMap 3  \\  & Rain & \\ \hline \multirow{3}{*}{Probabilities} & Red Light Violation & \\  & Stop Violation & Set by traffic analyst \\  & Obstacles & \\ \hline \multirow{3}{*}{Traffic} & Minimum traffic light cycle & \\  & Maximum traffic light cycle & \\  & Standard speed of people & \\  & Speeds by \(T_{\rm p}\) and \(T_{\rm s}\) & \\  & Distance between vehicles & \\ \hline \end{tabular}
\end{table} 
Table 2: Model parameters used by the queuing system to compute the waiting time at each service station. Figure 3: Leveled representation of model parameters and their relationships. Human, vehicle and external parameters and factors compose the modifiers that affect vehicle and pedestrian travel speed. This speed serves as a determinant for the waiting time of the system, which is also affected by the waiting time for a crosswalk. The pedestrian waiting time also depends on the number of violations committed.