## 2 Materials and Methods
### Data Analysis  
#### 2.2.1 Data Processing  
Data processing consists of three tasks: converting the logged history into experimental data, detecting behavior features, and creating sequence data for behavior model development. For data conversion, the logged histories obtained from the maneuvering simulator were converted into experimental data, as described in Table 5. Ship maneuvering is represented by port and starboard movement and velocity changes of the ship. Here, the navigator uses the rudder for left and right movement, and the engine uses speed for movement [24; 25]. Also, we selected four features because the risk of collision to both vessels can be assessed by deviation and dCPA [26]. For feature detection, using the detection rules presented in Table 6, four behavior features were detected with binary values (0 or 1). Two features, rudder use and engine use, were detected using a rudder reference value of \(\pm 5^{\circ}\) and an engine reference value of 10.13 MW. The rudder reference value is the minimum effective angle required for ship control, and the engine reference value is 3/4 of the maximum engine power [27]. In addition, the other two features, controlled deviation and controlled dCPA, were both detected using the same reference value of 361.6 m. The reference value was calculated as the bumper area of OS, considering the width of the passage [28; 29; 30]. The bumper area was calculated as the room required for collision avoidance [31; 32]. Note that unlike the detection of behavior features for device control, calculations of deviation and dCPA were required for the detection of behavioral features of route control. \begin{table}
\begin{tabular}{c c} \hline
**Type of Behavior** & **Type of Behavior Feature** \\ \hline Device Control & Rudder use \\  & Engine use \\ \hline Route Control & Controlled deviation \\  & Controlled distance of closest point of approaches (dCPA) \\ \hline \end{tabular}
\end{table} 
Table 4: Types of behavior and behavior features used in the study. \begin{table}
\begin{tabular}{c c} \hline
**Type** & **Description** \\ \hline Time & Ship-handling time (seconds) \\ \hline Position & Ship’s position (\(x,\ y\)): converted from position (latitude, longitude) in the geographic coordination system (ECS) to Cartesian coordinate system \\ \hline Course & Direction of ship’s route (\({}^{\circ}\)): converted from the azimuth in ECS to Cartesian coordinate system \\ \hline Speed & Ship’s speed (m/sec): Converted from knots (mile/hour) to speed (m/sec) \\ \hline Engine power & Used engine power (MW) \\ \hline Rudder angle & Ordered rudder angle (\({}^{\circ}\)) \\ \hline \end{tabular}
\end{table} 
Table 5: Types of experimental data obtained from the logged histories in the simulations. The deviation \(Dev(t)\) at time \(t\) between the position of the OS and the designed route at the beginning of the simulation was calculated as  
\[Dev(t) = \sqrt{\left(\psi_{\text{OS}(x)}(t)-\psi_{PR(x)}(t)\right)^{2}+\left( \psi_{\text{OS}(y)}(t)-\psi_{PR(y)}(t)\right)^{2}}, \tag{1}\]  
where \(\psi_{\text{OS}(x,\ y)}\) is the coordinate set of the position \((x_{OS},y_{OS})\) of the OS at time \(t\); \(\psi_{PR(x,y)}=(x_{PR},y_{PR})\) is the coordinate set of the estimated position of the designed route, which was calculated with the course and speed of the OS at time \(t=0\). The calculation of the distance of the CPA requires complex procedures and formulas, which have already been reported in various references [33,34]. Using the formulas in [35], \(dCPA(t)\) was calculated using the following procedure:  
* Step 1: Let \(\{\psi,\
u,\theta\}\) be the set of position \((\psi)\), speed \((\
u)\), and course \((\theta)\) at time \(t\). * Step 2: Obtain the set \(\{\psi_{\text{OS}},\
u_{\text{OS}},\theta_{\text{OS}}\}\) of the OS and the set \(\{\psi_{\text{TS}},\
u_{\text{TS}},\theta_{\text{TS}}\}\) of the TS.