# Collision Avoidance Behavior Mining Model Considering Encounter Scenarios
## 2 Methodology
### Recognition of Ship Encounter Scenarios
\tag{20}\]  
\[DCPA=S\times\sin(\phi_{R}-C-\pi)\quad TCPA=S\times\cos(\phi_{R}-C-\pi)/V_{R} \tag{21}\]  
In the formula, \(V_{xO}\) and \(V_{yO}\) are the velocity components of the first ship along the X and Y axes, respectively; \(V_{xT}\) and \(V_{yT}\) are the velocity components of the target ship along the X and Y axes, respectively; \(\phi_{O}\) and \(\phi_{T}\) are the headings (or the course over ground) of the first ship and the target ship, respectively; \(V_{R}\) is the relative velocity between the two ships; \(\phi_{R}\) is the direction of the relative velocity; and \(\alpha\) is the angle compensation factor. Based on the above formulas, the data from the collision avoidance turning point \(p_{o}\) are used as a filtering criterion to traverse the ship's AIS database and calculate the TCPA and the DCPA with other vessels at time \(t_{o}\). The vessels with a DCPA less than 1.5 nautical miles and a TCPA greater than 0 and less than 30 min are filtered, indicating that there is a collision risk with the target vessels \(p_{t}(t_{t},lon_{t},lat_{t},sog_{t},cog_{t})\). These data will provide support for the analysis of encountered scenario features later. (2) Ship encounter pair scenario identification  
According to the COLREGs, when two vessels are in a collision risk phase (with a relative distance between 3 and 6 nautical miles), the encounter scenario can be qualitatively divided into three main types: head-on encounter, overtaking, and crossing. This paper proposes a vessel encounter scenario classification standard based on the COLREGs using both the relative bearing and the course difference as classification criteria. Firstly, in a head-on encounter scenario, the target vessel should approach the first vessel on an opposite or nearly opposite course within a certain range. Therefore, the classification criterion for a head-on encounter is when the target vessel is within the first vessel's specific bearing range of 000\({}^{\circ}\) to 006\({}^{\circ}\) or 354\({}^{\circ}\) to 360\({}^{\circ}\) and the course difference between the two vessels is between 170\({}^{\circ}\) and 190\({}^{\circ}\). Secondly, in an overtaking scenario, both vessels should approach each other with similar courses within a certain bearing range. Classification based on course difference occurs when the course difference between the two vessels is less than 67.5\({}^{\circ}\) or greater than 292.5\({}^{\circ}\); classification based on bearing occurs when the first vessel, as the overtaking vessel, is within the target vessel's bearing range of 112.5\({}^{\circ}\) to 247.5\({}^{\circ}\); and, when the target vessel is the overtaking vessel, it should be within the first vessel's port or starboard bearing range of 67.5\({}^{\circ}\). Lastly, when the two vessels are neither in a head-on encounter nor an overtaking scenario, they are classified as being in a crossing scenario. In a crossing scenario, the first vessel is the give-way vessel, and the target vessel should be on the first vessel's starboard side, with the target vessel's bearing between 5\({}^{\circ}\) and 112.5\({}^{\circ}\). The encounter scenario classification rules are shown in Figure 8.  
Based on the previously searched ship encounter pair \(p_{o}\) and \(p_{t}\), the heading of the first vessel \(Cog^{\prime}_{os}\) is adjusted to 000\({}^{\circ}\), pointing to true north. At the same time, the heading of the target vessel \(Cog^{\prime}_{ts}\) is adjusted relative to the first vessel's heading. The parameters involved in determining the encounter scenario should include the relative distance \(S\), the target vessel's bearing \(C_{t}\) relative to the first vessel, the relative speed direction \(\phi_{R}\) between the two vessels, the time of encounter, and the course difference \(C_{diff}\) between the two vessels.