## 4 Method
### Transition Decision-Making Model  
At every time-stamp and for each agent, a new target cell is selected from the five possible candidate cells in the Moore neighborhood [43] to define the travelling trajectory, as represented in Figure 4. This choice is based on the probabilistic calculation performed on each candidate cell, and the cell with the highest probability is selected [12]. Applying the \(A^{*}\) algorithm [44] only as a routing technique does not specify where the processing for the routes exists nor does it capture the varying  
Figure 3: A finite state machine (FSM) representation corresponding to state transition of the agent’s behavior. conditions of congestions at any point in time. The agent \(a\) moves to the target cell which is the neighbor empty cell with the highest probability among Moore neighborhood cells in the next time-stamp. The transition probability, \(P(x,\ y)\), to move to an unoccupied neighbor cell \((x,\ y)\) is determined by the four factors: Static target floor field (_TFF_), obstacles floor field (_OFF_) [32], dynamic floor field (_DFF_) [15; 27], and the density around the next target cell (_Den_). _TFF_ is used to indicate the distances to a destination for every agent in the environment. A _TFF_ value is assigned to every cell to describe the distance to the earliest chosen target. The second floor field is made out of obstacle fields, which are considered repulsive forces. These two floor fields are static. The last two types of floor fields are the dynamic and density fields that give an indication of how the occupancy of every single cell surrounding the agent changes along with time in order to avoid collisions. In each time-stamp, the dynamic floor field \(D_{ij}\) decays with some probability and diffuses with some probability to one of its eight neighbor cells as follows:  
\[ \begin{array}{ll}D_{ij}^{l+1}=&(1-\alpha)(1-\delta)D_{ij}^{t}\\ &\qquad\qquad+\frac{a(1-\delta)}{4}\left(D_{i+1,j}^{t}\ +D_{i-1,j}^{t}\ +D_{i+1,j+1}^{t}+D_{i+1,j-1}^{t}+D_{i,j+1}^{t}\right. \\ &\qquad\qquad+D_{i-1,j+1}^{t}+D_{i,j-1}^{t}\ +D_{i-1,j-1}^{t}),\end{array}  \tag{1}\]  
where \(\alpha\) is the diffusion probability that represents the randomness of an agent's movement and \(\delta\) is the decay probability that reflects the agent's visible range. One of the key elements of the model is the collision avoidance sub-model. It provides the ability to calculate potential interactions between vehicles. The model is able to calculate the density around each cell. It is measured based on the number of vehicles within the specified space of range \(r\). It insures the avoidance of collision while taking the best trajectory. The model provides an awareness of when a possible interaction between vehicles can or will occur during travel, and it enables each agent to be aware of potential interactions with other agents. The obstacles' static potential field is calculated as follows:  
\[OFF(x,\ y)=\min(D_{max},\ d_{x,y})\, \tag{2}\]  
where \(d_{x,y}\) represents the minimum distance from the obstacles and \(D_{max}\) is the maximum distance at which people are influenced by the obstacles. For each agent \(a_{i}\), the transition probability is calculated to each empty cell \((x,\ y)\) in its Moore neighborhood as follows:  
\[P(x,\ y)=N\exp(-k_{T}\ TFF(x,\ y)+k_{D}\ DFF(x,y)+k_{O}OFF(x,y)+k_{den}\ Den(x,y)+k_{I}\,I), \tag{3}\]  
Figure 4: The next time-stamp target cells. where: \(N\) is the normalization coefficient; \(TFF(x,\ y)\) is the target static potential field value; \(DFF(x,\ y)\) is the value of the dynamic floor field; \(OFF(x,y)\) is the obstacles floor field value; \(Den(x,y)\) is the value of the density field; \(I\) is the inertia parameter; \(k_{T},k_{O},k_{D}\), and \(k_{den}\in[0,\ \infty)\) are the weight sensitivity parameters of the target, obstacles, dynamic, and density floor fields, respectively; and \(k_{I}\) is the weight sensitivity parameter of the inertia.