## 7 Risk Assessment  
With the point-of-conflict prediction, the pedestrian agent would observe the POC's position and assess its risk instead of using the obstacle's position and danger level. As previously discussed in Section 4.1, risk is calculated based on the obstacle's harm and the probability of collision, which is formulated as  
\[r=harm\cdot P, \tag{17}\]  
where \(r\) is the risk, \(harm\) is the possible harm caused by the obstacle, and \(P\) is the probability of collision with the obstacle. To conform to the agent's observations in our reinforcement learning model, all values \(r\), \(harm\) and \(P\) have a range from 0 to 1. To estimate the probability of collision, we need to specify the proximity of the POC's position to the navigation path. Because the risk assessment is carried out before the path-planning task, the navigation path could be approximated as a straight line from the agent's position to its current destination. The distance from the POC's position \((x_{POC},y_{POC})\) and agent's estimated navigation line is calculated by:  
\[\delta_{POC}=\frac{|Ax_{POC}+By_{POC}+C|}{\sqrt{A^{2}+B^{2}}}, \tag{18}\]  
with \(A=y_{D}-y_{a}\), \(B=x_{a}-x_{D}\), and \(C=(x_{D}-x_{a})y_{a}-(y_{D}-y_{a})x_{a}\),  
where \((x_{a},y_{a})\) and \((x_{D},y_{D})\) are the coordinates of the agent and obstacle, respectively. The collision probability \(P\) is highest when \(\delta_{POC}=0\), and gradually decline with higher \(\delta_{POC}\). \(P\) is formulated in our model as follows:  
\[P=\frac{M}{\delta_{POC}+M}, \tag{19}\]  
where \(M\) is a distance constant. For instance, in our implementation, we adopted using \(M=3\), which means when \(\delta_{POC}\) is 3 m, the collision probability \(P\) would be at 0.5. To estimate the harm from the obstacle, we use the obstacle's danger level and also its speed, as the speed could also impact the harm caused by the obstacle [40]. As an example, the risk observed from a person running at a high speed should be higher than the risk observed from a person walking at a normal speed toward the agent, even when the perceived danger from the two persons are the same. Arguably, the obstacle's speed could also contribute to the probability of the agent's avoidance. However, because the agent's navigation path was not formed at the current process, the avoidance probability is unspecified. Assuming the capability of avoidance of the pedestrian agent is constant, the obstacle's speed should not affect the probability of collision \(P\). In the case that the obstacle's speed is irrelevant, such as a static obstacle, the harm of the obstacle is equivalent to its danger level. Otherwise, we adopt using the concept of kinetic energy to estimate the harm of the obstacle, similar to how humans feel the impact of a moving object when it hits. As a result, harm is formulated as  
\[harm=max\bigg{(}1,danger\bigg{(}1+\gamma\frac{K_{obs}}{K_{normal}}\bigg{)} \bigg{)}, \tag{20}\]  
where \(K_{obs}\) is the kinetic energy of the moving obstacle, \(K_{normal}\) is the kinetic energy of an object moving at a normal speed, and \(\gamma\) is the discount value. Considering \(K=\frac{1}{2}mv^{2}\), the harm of a moving obstacle could be formulated as follows:  
\[harm=max\Bigg{(}1,danger\Bigg{(}1+\gamma\bigg{(}\frac{v_{obs}}{v_{normal}}\bigg{)} ^{2}\Bigg{)}\Bigg{)}, \tag{21}\]  
where \(v_{normal}\) is the average speed of a moving object which could be perceived as normal. In several studies [41; 42; 43], \(v_{normal}\) is specified to be approximately 1.31 m/s. Finally, with the harm value calculated, the risk of the obstacle is formulated by Equation (17). This risk value together with the POC's position specified in Section 6, is used in the agent's observations in the pedestrian reinforcement learning model. More specifically, regarding the obstacle's properties, the pedestrian agent will observe the POC's relative coordinates, the obstacle's size, and the risk formulated in this section.