# A Novel Method for Risk Assessment and Simulation of Collision Avoidance for Vessels based on AIS
## 5 Building a Simulation Program  
The algorithm test data of the simulation program comes from assuming that the vessel is moving in the open sea with good visibility, as the data of ship encounter status are from the AIS. The ship length is 50 m, and the ship height is 15 m. The weather conditions, wind speed, wave intensity, and sea current are normal. The vision of the watching sailor is good. The weight given to each parameter was set to be the AHP algorithm in the case that the quantitative ratings were not available. Among the factors that affect collisions, TCPA is the most important, and so we set \(\alpha_{TCPA}=0.5\). The distance between the two ships was also a major influencing factor, especially in the area with a large crossing of boats; thus, we set \(\alpha_{R}=0.3\). DCPA has an influence on the size of the ship, so we set \(\alpha_{DCPA}=0.1\). The azimuth between the two ships affects the reverse ability of the ship, and changes the direction of the ship; thus, we set \(\alpha_{\Delta B}=0.1\).  
The marine collision risk assessment model is applied by simulating the parameters of the host and target vessels, and by using the C++ and Qt tools. The criteria for calculating the CRI and issuing a warning are as follows: when \(CRI\geq 0.6667\), there is a high probability of collision, so the vessel needs to take immediate action to avoid the collision. When \(0.3333\leq CRI<0.6667\), it is likely to collide, and so the vessel needs to be noted. When \(CRI<~{}0.3333\), there is a low probability of collision, so the vessel needs to be tracked.  
The general procedure for the proposed approach is shown in Figure 5, and the information from the AIS was calculated. If the collision probability of the ship and the target ship is high, the system will issue a warning and ask the crew to consider the situation, then the crew needs to take action to avoid the collision, referring to the requirements stated in Chapter 2 of the \"Convention on International Regulation for the preventing Collision at Sea (1972)\".  
The applications of some specific cases are summarized in Table 1.  
In Table 1, 10 cases corresponded to the situations encountered in Figure 4. The collision capability was assessed by the CRI, which increases with a decrease in the distance between the two ships, and an increase of the speed between the two ships. CRI is usually large in the case of two ships in head-on, overtaken, and being overtaken situations. CRI is usually small in the case of two ships in board and starboard. The CRI reflects the collision more accurately than when only observing the TCPA and DCPA.  
Simulation results are shown in Figure 6:  
\begin{table}
\begin{tabular}{c l c c c c c c c} \hline \hline
**No.** & **Situation** & **Course (\({}^{\circ}\))** & **Azimuth (\({}^{\circ}\))** & **Speed (kn)** & **Distance (miles)** & **DCPA (miles)** & **TCPA (hr)** & **CRI** \\ \hline
1 & Head-on & 175 & 3 & 12 & 5 & 0.6959 & 0.4126 & 0.2925 \\
2 & Head-on & 180 & 5 & 15 & 5 & 0.4358 & 0.3321 & 0.3286 \\
3 & Starboard & 275 & 30 & 15 & 8 & 7.2505 & 0.2254 & 0.5325 \\
4 & Starboard & 200 & 25 & 13 & 10 & 0.8716 & 0.763 & 0.1968 \\
5 & Board & 162 & 33 & 15 & 12 & 9.3258 & 0.5035 & 0.5395 \\
6 & Board & 130 & 110 & 6 & 11 & 3.7622 & 1.7228 & 0.0001 \\
7 & Overtaking & 0 & 356 & 8 & 3 & 0.2093 & 0.3741 & 0.4266 \\
8 & Overtaking & 280 & 15 & 10 & 5 & 4.9810 & 0.0436 & 0.6077 \\
9 & Being overtaken & 8 & 150 & 14 & 2 & 1.2313 & 0.1126 & 0.7363 \\
10 & Being overtaken & 11 & 170 & 13 & 1.5 & 0.5376 & 0.1077 & 0.8736 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of some specific cases.  
Figure 5: The general procedure for the proposed approach.  
Figure 6: Image simulation.  
Figure 6 shows a simulation program that calculates the possibility of collision between ships while traveling around other ships. The possibility of collision depends on the location, the direction of travel, the speed, and the distance between ships with a corresponding CRI.