COLREGs Compliant Fuzzy-Based Collision Avoidance System for Multiple Ship Encounters

: As the number of ships for marine transportation increases with the advancement of global trade, encountering multiple ships in marine trafﬁc becomes common. This situation raises the risk of collision of the ships; hence, this paper proposes a novel Fuzzy-logic based intelligent conﬂict detection and resolution algorithm, where the collision courses and possible avoiding actions are analysed by considering ship motion dynamics and the input and output fuzzy membership functions are derived. As a conﬂict detection module, the Collision Risk (CR) is measured for each ship by using a scaled nondimensional Distance to the Closest Point of Approach ( DCPA ) and Time to the Closest Point of Approach ( TCPA ) as inputs. Afterwards, the decisions for collision avoidance are made based on the calculated CR, encountering angle and relative angle of each ship measured from others. In this regard, the rules for the Fuzzy interface system are deﬁned in accordance with the COLREGs, and the whole system is implemented on the MATLAB Simulink platform. In addition, to deal with the multiple ship encounters, the paper proposes a unique maximum-course and minimum-speed change approach for decision making, which has been found to be efﬁcient to solve Imazu problems, and other complicated multiple-ship encounters.


Introduction
A ship is different in its own navigation operation from other traffic vehicles as it has a comparatively large mass, therefore, a large time constant. In addition, there are, in general, no visible traffic rules and separation lanes at all. Therefore, navigating a ship through dense traffic or congested waterways is not an easy task, and a navigator must be trained thoroughly and properly to avoid marine incidents in any unforeseen situation. Despite doing so, nowadays, the rate of collision among ships has been gradually increasing [1], and most of these casualties are found mainly due to human mistakes [2]. As many of the wrong decisions and miscalculation by humans results in marine casualties and environmental disasters, it is paramount to replace the human subjective factors by an intelligent decision-making system for ship navigation and collision avoidance.
The existing collision prevention technologies are mainly developed from two different perspectives. One is for assisting Officers On Watch (OOW) on board by detecting ship conflicts and setting alarms, and the other is for eliminating the human factors by proposing complete conflict resolution. Research on situational awareness had been carried out since the 1950s [3], and the outcomes are commendable to support onboard officers, such as automatic radar plotting aid, ship domain approach etc. However, getting a reliable collision-free solution based on International Regulations for Preventing Collisions at Sea (COLREGs) rules [4] for multiple ship encounters is still challenging as encountering situations is becoming more complex due to increased traffic density. length in an encounter to consider the effect of the ship size, and TCPA is divided by the largest ship length and multiplied by relative speed to take the influence of ship speed into account. In addition, considering the fact that the challenge to overcome any ship conflicts depends on the number of ships involved in that encounter, the Fuzzy membership functions are normalized by using scale factor (SF), where the SF can be tuned based on the expert choice to alter the risk value if necessary.
Once the conflict is detected, the next step is to find a reliable solution to avoid collisions. This conflict resolution module is the core of any collision prevention system. Many methods have been developed so far by different researchers in this regard. The rule-based method is one of those where a set of pre-set rules is used to avoid collisions. Naeem et al. [16] and Tam and Bucknall [17] used pre-set course change method, while Fang et al. [18] proposed to enlarge rudder angle until the trajectory is collision-free. Praczyk [19] mentioned Neural Network (NN) as a suggestion tool for rule-complaint actions, while Perera et al. [20] suggested Bayesian network for the same. The main advantage of this rule-based method is the COLREGs rules, and good seamanship can be treated in the rule system explicitly. However, many researchers believe that this cannot enumerate all the scenarios of multiple ship encounters. The virtual vector field method is another method where Artificial Potential Field (APF) [21,22] generates the repulsive potential around the obstacles and attractive potential to the destination. However, while using this method, the ship might trap in local minima, and ships' dynamics are not taken fully into account. Discretizing the solution-space of the ship and choose the safest collisionfree path with fixed control inputs is another way to resolve the ship conflicts issues. Benjamin [23] used optimization to get such collision-free solutions, while Szlapczynski [24] incorporated the ship domain approach with this method to make it more realistic. This method could consider the ship dynamics, but the calculation of input is time-consuming.
In general, the rule-based methods are simple and easy to define the COLREGs rules explicitly. Therefore, for the conflict resolution module, this research proposes a Fuzzy-logic based decision-making platform. Unlike others, instead of taking the decision based only on Collison Risk (CR), encountering and relative angles of each ship measured from others are also considered, and the corresponding membership functions are derived. This allows the system to consider all possible types of encounters and take decisions accordingly. COLREGs compliant rules are then implemented in the Fuzzy platform to take more realistic actions to avoid ship collision. To deal with multiple ship encounter, this paper proposes a simple but effective approach where each ship compares its evasive actions to avoid other existing ships, and the maximum-course and minimum-speed change approach is chosen in the decision-making process. By considering this approach, a ship would be able to satisfy all course changing requirements to avoid other ships. The ship also sacrifices its speed for a minimum time, allowing her to maintain its manoeuvrability while changing course. A conventional PD controller is then used to execute the command for course changing manoeuvre to take the appropriate rudder. The coefficients in the controller are tuned for each ship to ensure the minimum overshoot and less settle time. On the other hand, the speed change is considered by using a speed response equation. The information flow among the modules for the proposed collision avoidance system is given in Figure 1.
Simulations are done to justify the effectiveness of this novel collision avoidance system, and the ships are tested to avoid collisions in 22 complex scenarios named Imazu problem [25]. Some rather difficult situations of five ship encounters are also investigated, and the results are included in this paper. This paper is organized as follows: Section 2 explains the marine traffic rules and regulations and their importance in navigation. Section 3 includes a brief description of the mathematical model used for motion prediction. In Section 4, the Fuzzy-based conflict detection module is explained. Section 5 explains the core of the avoidance system, i.e., conflict resolution module for multiple ship encounters, and its execution. Section 6 shows the simulation results for the Imazu problems and other complex encountering situations. Finally, Section 7 concludes the overall findings and proposes some future works.

Marine Traffic Rules and Regulation
In marine traffic, all ships should abide by certain laws while trying to avoid collisions. These laws are formulated by International Maritime Organization (IMO) in 1972 and named International Regulations for Preventing Collisions at Sea (COLREGs). This 1972 convention [4] was designed to update and replace the Collision Regulations of 1960. The COLREGS includes 41 rules divided into six categories, which are: Part A (General), Part B (Steering and Sailing), Part C (Lights and Shapes), Part D (Sound and Light signals), Part E (Exemptions), and Part F (Verification of compliance with the provisions of the Convention). There are also four Annexes containing technical requirements concerning lights, sound signalling appliances, and additional signals for finishing vessels and international distress signals. However, this paper focuses only on Part B (Steering and sailing).
It is a matter of fact that several studies on ship collision avoidance systems have considered the COLREGs rule in their algorithm [26,27] and several ignore these completely [13]. A system ignoring the COLREGs rules might successfully avoid ship collisions. However, as the actions suggested by the resolution module violate the laws at sea, these are not acceptable in real practice. Statistics [28] reveal that 56% of major maritime collisions occur due to the violation of COLREGS rules. Therefore, it is crucial to choose an appropriate method for the collision avoidance system, which can incorporate the given rules appropriately. The terms 'Give way' and 'Stand on' ship are frequently used in the rules. According to the COLREGs, ships coming from starboard side are referred as 'Stand on' ship and have a higher priority for navigation. Thus, most of the time, the 'Stand on' ship keeps its original course and speed without any alteration. On the other hand, the ship coming from the port side is termed as 'Give way' ship. 'Give way' ship has less priority for navigator, and thus takes necessary actions to avoid the 'Stand on' ship.
Maintaining a safe distance among the ships in marine traffic is paramount to enhance maritime safety. Therefore, COLREGs [rule 13(a)] emphasizes specifically maintaining a safe distance between two ships in overtaking and head-on situation. Such encountering situations are demonstrated in Figure 2a,b. Crossing an encounter of two ships is another situation that involves high risk. For this type of encounter, COLREGs mention the ships should take early actions to avoid situations of crossing ahead with the risk of collision in starboard to starboard and must be passing by port to port. Different crossing situations are mentioned in the COLREGs (rule 15). Figure 2c-f illustrates the crossing situations where the own ship is in a 'Give way' situation, whereas in Figure 2g-j, in 'Stand on' situation. Although a 'Stand on' ship is believed not to take any action to avoid a collision, the statement is not always true. COLREGs rule 17(b) mentions that: "When, from any cause, the vessel required to keep her course and speed finds herself so close that collision cannot be avoided by the action of the "Give way" vessel alone, she shall take such action as will best aid to avoid a collision." This means that if the 'Give way' ship does not take any appropriate actions to avoid the collision as required by the COLREGs rules, the 'Stand on' ship is forced to take appropriate actions to avoid a collision.
However, the actions taken by the 'Stand on' ship must be carefully formulated as there are no specific rules on it. In addition, COLREGs rule 8(b) mentions that: "Any alteration of course and/or speed to avoid collision shall if the circumstances of the case admit, be large enough to be readily apparent to another vessel observing visually or by radar; a succession of small alterations of course and/or speed should be avoided." This rule highlights that the ship course and/or speed change in ocean navigation must be executed to avoid collision situations at any cost, and the action must be distinguishable by other ships.
Although these COLREGs rules are established in 1972, some issues hinder the practical implementation of the rules in ocean navigation. For example, all the rules are explained for two ship encounters. Therefore, in a multiple ship encounter, when a particular ship becomes both 'Give way' and 'Stand on' ship at the same time (when two other ships are approaching from its port and starboard side), COLREGs cannot give a solution. Additionally, when the 'target ship' (the ship that must be avoided in an encountering situation) has a very low or high speed compared to the 'own ship' (the ship that needs to take action to avoid the target ship), the rules become questionable. Therefore, in addition to the COLREGs rules, experts' knowledge also needs to be considered to take the appropriate decision. Hence, this study proposes Fuzzy-logic based collision avoidance system, in which not only 'Give way' ships but 'Stand on' ships also take action if the risk becomes too high or unbearable.

Mathematical Model for Ship Motion Prediction
The motion prediction module is an integrated part of a collision-avoidance system that contains the process of predicting the trajectories of ships. When a ship encounters other ships, the system uses these forecasted trajectories to detect ship conflicts and decisionmaking. Therefore, the success of the whole system is very much related to the accuracy of the predicted trajectories. Researchers have found that the dynamic model [6][7][8] is the best to predict the ship motion as it considers the inertia effect and can predict the velocity change in hard manoeuvring. However, due to the complexity of the dynamic model, researchers prefer to use simplified models to design collision avoidance approaches, which are less precise but serve the purposes [29].

Prediction of Ship State
This research considers a first-order simplified response equation to describe the ships' dynamics and assumes that the surge velocity is constant and there is no sway velocity. The coordinate system considered in this study to define the ship motion is given in Figure 3. A similar model is also used by Fang et al. [18] and Liu et al. [30], which is known as 'Nomoto model', named after Nomoto. He has done this simplified ship dynamic approach and shown the following form of equations.
where, L is the ship length, U is resultant ship speed, u is the surge speed, v is the sway speed, r is the yaw rate, ψ is the ship heading, δ is the rudder angle,Ḱ = K L U is the non-dimensional steering gain, andT = T U L is the non-dimensional time constant for yaw motion. The manoeuvring indices K and T for a particular ship can be calculated using its zigzag test results [31]. The smaller the value of T, the faster the ship will respond, and vice versa. Usually, the time constant of a ship is a time when the response reaches 63.21% of the target value. This paper adopts 20 ships data from the paper of Aulia [32], where the T value ranges from 33.36 to 418.60 s. Table 1 provides the necessary information for the 20 different ship types considered in this research. MATLAB Simulink platform has been utilized to create the ship state subsystem in this study, and Equation (1) is solved numerically using Runge-Kutta method to get the state vector X = [r; ψ; x; y] for each time step for given rudder angle, δ.

Speed Response Model
Nomoto model assumes that the surge speed of a ship is unchanged, and the sway speed is zero. However, according to the COLREGs rules, a ship might need to change its speed to avoid collisions. Thus, this research considers the following speed response equation to predict the change in surge speed for any given command.
The solution of the above speed response equation is given by: where T U is the time constant for ship speed, u 0 is the initial speed, u * is the command speed, and u is the actual speed of a ship. The value of T U is chosen so that it represents the time taken for a ship to reach 63.21% of this command speed. This can be proven by substituting t = T U in Equation (3). In addition, the study considers pure yaw motion while course changing, i.e., sway velocity is considered as zero.
MATLAB Simulink is used to model this speed response subsystem, and Equation (2) is solved together with Equation (1) using Runge-Kutta method.

Rudder Response Model
Like the speed response model, the rudder movement is predicted using a rudder response model, as given in Equation (4).
where T E is the rudder response time, δ * is the command rudder angle, and δ is the actual rudder angle.
Considering the δ 0 , the initial rudder as zero, the solution of the above rudder response equation is given by: In this study, T E is considered as 2.3 s as proposed by many other researchers to predict the rudder movement more realistically. Then the Equation (4) is solved in the Matlab Simulink platform together with Equations (1) and (2).

Module for Ship Conflict Detection
Either in a manned ship or unmanned ship, one essential module of a collision avoidance system is the conflict detection module, which assesses the collision risk and alerts the system to take evasive actions. This conflict detection module mostly assesses the risk based on answering the following three questions: Question 1: Who are the potential threats in an encounter? (Detect the collision candidates) Question 2: How far are the threats to collide? (Measure the distance to collide) Question 3: At what time will they collide? (Measure the time to collide) Many measures have been developed to answer the above questions. However, the Closest Point of Approach (CPA) concept is the most widely used approach both in the maritime and aviation industries [33]. In this CPA approach, two widely used indicators are Distance to CPA (DCPA) and Time to CPA (TCPA). The measure of DCPA answers Question 2, whereas TCPA answers Question 3. However, to get the answer to Question 1, different researchers proposed different strategies that utilities the values of DCPA and TCPA.

Selection of Risk Indicators for the Module
This research prefers the CPA approach to assess the risk. There are two major alternative methods available in this regard-model-based method and expert-based method-and this research opts for the latter due to its wide acceptability. Some researchers believed that solely DCPA and TPCA vales are not enough to calculate the risk, and, therefore, they have mentioned different risk indicators (RIs) [12]. Several studies carefully examine the other possible RIs to calculate the CR in a more realistic way and found that the ship length and relative speed are the most impactful parameters that can alter the CR drastically if not being considered while measuring the risk. Other parameters, such as relative angle, encountering angle, etc. are useful for decision-making process, not for CR measurement.
In this research, instead of treating the ship length, relative speed, DCPA, and TCPA independently while measuring the risk of ships in an encounter, nondimensional DCPA (DCPA ) and nondimensional TCPA (TCPA ) are used. In the nondimensional forms, the DCPA is divided by the maximum ship length in an encounter, and the TCPA is divided by the maximum ship length and multiplied by relative ship speed. This approach not only reduces the number of variables but also allows the module to fine-tune the risk measurement, especially for larger vessels. Figure 4 illustrates a two-ship encounter to help understand the DCPA and TCPA concept and their calculations, where U 1 , U 2 are ship velocities, ψ 1 , ψ 2 are ship headings, (x 1 , y 1 ), (x 2 , y 2 ) are ship positions, D is the distance between the centroid of two ships, and RV is the relative velocity. The values of DCPA and TCPA are directly related to the ship's position, velocity, and course. If these values are known accurately, the following equations are used to calculate TCPA and DCPA.
The TCPA and DCPA are non-dimensionalised using the following equations where the largest ship size is considered in the denominator. By doing so, the DCPA and TCPA can be tuned, and so as the collision risk based on the largest ship size in any particular encounter. Otherwise, the system would consider the same risk for a ship when it meets ships of different sizes, which are not realistic.
These DCPA and TCPA are dynamic and are always updated with the ship states. It is also mentioned that once a ship passes its CPA, TCPA turns to a negative value.

Fuzzy Inference System (FIS) to Measure CR
Fuzzy logic is a widely known method for decision making purposes [34,35]. Due to its ability to deal with the imprecision, i.e., uncertainly of human nature, and describe a system linguistically through rule statements, it gains its huge popularity. Fuzzy inference system (FIS) usually consists of four major components, which are: fuzzification of crisp inputs, construction of fuzzy rules, implementation of rules to get the fuzzy result, and at last, defuzzification of fuzzy result into a crisp output. This research uses the FIS to measures the CR for any given ship conflict. Figure 5 shows the framework of this system for better understanding. A detail of its four components is given in the following sub-sections.

The Fuzzification Interface
The main task of this interface is to map the crisp inputs from 0 to 1 by using a set of membership functions. Here, DCPA and TCPA are considered as two crisp inputs. Four and eight linguistic variables are considered and mapped carefully for DCPA and TCPA , respectively. The linguistics values used for DCPA are DA (danger advance), DM (danger medium), ME (medium), SM (safe medium), and SA (safe advance), and for TCPA are SAN (safe advance negative), MEN (medium negative), DAN (danger advance negative), DAP (danger advance positive), DMP (danger medium positive), MEP (medium positive), SMP (safe medium positive), and SAP (safe advance positive). For a fixed set of membership functions and a given set of inputs, the system is then designed to calculate the CR as per defined rules. The rules are prepared based on expert knowledge, which is, if DCPA and TCPA are small, CR is big, and vice versa. However, it is believed that CR should be higher for the same set of DCPA and TCPA , if the encountering situation involved more than two ships. Therefore, an adaptive membership function is necessary to consider the effect of different numbers of ships in an encounter. In this regard, this study considers the scale factor (SF) to normalise the maximum value of the mapping. The user can tune this SF value as per need. Usually, for a higher number of ships encounter, an increase in SF value results in a higher value of CR, thus raising the level of awareness of the situation.
MATLAB Fuzzy Toolbox is used to create the memberships for DCPA and TCPA as shown in Figure 6. For the output, eight linguistic variables are considered and mapped for CR. The negative value of CR means that the risk has just passed, whereas zero means no risk and 1 means the highest risk. Figure 7 shows the membership function used for measuring CR. The membership function for CR is used for defuzzification, i.e., to convert the fuzzy output to a crisp output.

Fuzzy Rule Base
A series of linguistic statements or rules are defined in the FIS system to calculate the CR based on DCPA and TCPA . In order to reason the value of CR, the fuzzy rules are expressed in the form of IF-THEN to describe the relationships between the inputs and output. The rules are defined in the MATLAB Fuzzy Toolbox platform and shown in Table 2. A 3D surface plot of the rules is shown on the left side of Figure 8, which indicates that CR is high when the DCPA and TCPA are small. Additionally, the right side of Figure 8 demonstrates the contour map for rules.

Decision Making Units
There are two widely known inference methods in the FIS. These are Mamdani's fuzzy inference method and Takagi-Sugeno's fuzzy inference method. The first two parts of the Mamdani and Sugeno type FIS, i.e., fuzzifying the inputs and applying the fuzzy rules, are exactly the same. The main difference between these two FISs is that Sugeno output membership functions are either linear or constant. On the other hand, in Mamdani FIS, the output of each rule can be a fuzzy logic set. Thus, the Mamdani type is intuitive and well suited to human input. Therefore, Mamdani type is adopted in this research as this study involves human experience sharing for collision risk calculation.

Defuzzification Interface
Defuzzification is needed for Mamdani type FIS. This is the step to convert the fuzzy output to a crisp output. MATLAB Fuzzy logic toolbox supports five built-in methods for the defuzzification process. These are Centroid, Bisector, Middle of Maximum (MOM), Smallest of Maximum (SOM), and Largest of Maximum (LOM). This study chooses centroid defuzzification method that returns the centre of gravity of the fuzzy set along x-axis. The centroid is computed using the following formula where µ(x i ) is the membership value for point x i in the universe of discourse.

Module for Conflicts Resolution and Execution
In recent years, many techniques have been proposed for solving collision avoidance problems. These techniques have implemented many rules when deciding the evasion actions to avoid a collision. However, the development of a completely COLREGs rules compliant system is still blank. Some researchers used some popular rules, such as Rule 6, 8, 13-19, in their algorithm. However, these rules address the obligations of ships in two ship encounters; thus, choosing the most suitable rule is difficult for multiple ship encounters. In addition, the COLREGs rules are written for the OOWs in human language [36], which does not have any quantifying information for execution. Additionally, the ship is asked to keep at a safe speed or distance, while the values of the safe speed and distance are not addressed in the rules. Therefore, compliance with COLREGs rules strongly depends on experts' knowledge and good seamanship [37]. This research shows the effort of interpreting the COLREGs rules in various encountering situations through a Fuzzy logic-based decisionmaking platform.

Selection of Inputs for Fuzzy Based Decision Making System
Considering appropriate and impactful input parameters for a FIS while taking evasion actions for collision avoidance is very crucial. Perara et al. [38] considered four inputs, namely, collision distance, collision region, relative speed ratios, and relative collision angle to define the corresponding membership functions. The decision was made based on the defined fuzzy rules without considering the collision risk (CR) separately. On the contrary, in this study, CR is considered as one of the prime inputs for decision making, which is available from the conflict detection module where the TCPA, DCPA, ship size and relative velocity effects are already taken into account. In addition, to implement the COLREGs rules, encountering and relative angles are considered (which defines the encountering types) together with CR for the decision-making process. Figure 9 illustrates the encountering and relative angle in a two-ship encounter, where D 12 is the distance between ship 1 and ship 2, U 1 and U 2 are the velocities of ship 1 and ship 2, ψ 1 and ψ 2 are the headings of ship 1 and ship 2, θ 12 is the angle that the line joining ship 1 and ship 2 makes from the north of ship 1, θ 21 is angle that the line joining ship 1 and ship 2 makes from the north of ship 2, ψ rlv,12 is the relative angle of ship 2 measured from ship 1 bow, ψ rlv,21 is the relative angle of ship 1 measured from ship 2 bow, ψ enc,12 is the encountering angle of ship 2 measured from ship 1, and ψ enc,21 is the encountering angle of ship 1 measures from ship 2. The following set of equations is used to calculate the encountering and relative angle of ship 2 measured from ship 1.

Calculation of Encountering Type
Encountering type can be identified by using the encountering and relative angle of each ship measured from others. In this study, the surrounding of each ship is divided into 7 zones based on the relative angles, and for each zone, the encountering types are defined based on the encountering angles. Figure 10 shows the 7 different encountering types identified in this research. These encountering types are then marked based on the relative and encountering angle, as shown in Figure 11. This figure is then used to define the COLREGs Fuzzy compliant rules, and the actions are taken based on experts' knowledge.

Fuzzy Inference System (FIS) for Decision Making
In order to map the crisp inputs to fuzzy inputs, membership functions are designed for relative angle, encountering angle, and collision risk. Considering Figure 11, seven and ten linguistic variables are defined and mapped for relative and encountering angle, respectively. On the other hand, five variables are considered for CR to map the risk value. MATLAB Fuzzy Toolbox is used to create the membership functions as shown in Figure 12.
The decisions are made either by changing the course or changing speed or changing both simultaneously. Seven and five linguistic variables are considered and mapped to define the membership functions for the course and percentage of speed change, respectively, and shown in Figure 13. These membership functions are used for defuzzification, i.e., to convert the fuzzy outputs to crisp outputs.    Fuzzy rules are defined according to the COLREGs rules. These relative and encountering angles in a ship encounter enable the fuzzy system to distinguish the give-way and stand-on ships, and then, actions are taken based on the CR values. The actions are reasoned as large values so that it is distinguishable by other ships. Moreover, if the actions taken by the give-way ships are not enough to reduce risk, the stand on ships are also reasoned to take adequate actions to avoid a collision. In this study, CR > 0.9 is defined as this very-very high (VVH) risky situation, and once it reaches a critical point, the stand-on ships are allowed to take action together with the give-away ships. It is mentioned that although the membership functions for heading and speed change contain both positive and negative values, at this stage, port side turning and increase of speed are avoided while defining the fuzzy rules. Table 3 shows the Fuzzy rules considered in the FIS as a decision-making platform.

Decision Making for Multiple Ship Encounters
This study considers many-to-many situations where each ship is allowed to take action depending on others' actions. It is based on the assumption that the ships can exchange their state information via a communication or coordination structure. In a multiple ship encounter, the proposed FIS calculates the possible avoiding action for each ship to avoid others. Since the actions are different from avoiding different ships in an encounter, a ship always has more than one option to avoid the collision. In such a situation, this research proposes to compare the available options for each time step and considers the largest course change and the smallest speed change option as an overall action to avoid its surrounded ships. To understand this approach, let us consider a three-ship encountering situation, where the FIS calculates for Ship 1 to take 150 to avoid ship 2 and 450 to avoid ship 3. In this situation, if ship 1 takes 150 to avoid ship 1, it might collide with ship 2. However, if it takes 450 to avoid ship 2 as a maximum course changing approach, it already covers the requirement to avoid ship 1. On the other hand, as reductions in speed decrease a ship's manoeuvrability, this study prefers a minimum speed reduction approach for multiple ship encounters to allow the ship to consider maximum course change without sacrificing its manoeuvrability. Figure 14 demonstrates a similar three-ship encountering situation, where each ship has two options to avoid the other two ships. Therefore, based on maximum-course and minimum-speed change, the decisions are taken for each ship to avoid others. This unique maximum-course and minimum-speed-change approach for decision making approach has been found to be effective and tested for complicated multiple ship encounters. The results are included in Section 6.

Implementing FIS Decisions to the Ship Sytem
As a conflict resolution model, in this study, the FIS is designed to choose whether to alter course or speed or both simultaneously based on the dynamic CR, encountering and relative angle of each ship measured from others. To consider the speed change, the speed response model as mentioned in Section 3.2 is used.
On the other hand, to take an appropriate rudder angle for any given course alteration, a conventional Proportional-Derivative (PD) feedback controller is used as shown in Equation (15).
where δ * is the command rudder, ψ error is the heading error, i.e., the difference between the actual and command heading, r is the yaw rate, K P is the proportional gain, and K D is the differential gain. The FIS is designed to take maximum 45 • course change at highest risk, and a ship is capable of taking maximum 35 • rudder to alter its course. Based on these two facts, the value of K P is tuned and selected. On the other hand, K D is tuned for each ship based on its response rate and minimizes overshoot and settling time while taking the rudder. Figure 15 shows a typical layout of a PD controller used in this study. In this study, as developing the PD controller is not the main concern, the trial-and-error process is adopted to tune the values. These pre-selected K P and K D values are then used in Equation (15) to get the rudder command for any given course changing manoeuvring.

Results and Discussion
The integrity of the developed modules for the proposed collision avoidance system is tested for ships in different encountering situations. Initially, two ship encountering situations are examined. Following that, the system is tested for a maximum of five ship encounters. The proposed system is also investigated for different ships with different manoeuvring characteristics, ship size, and speed. Finally, Imuzu-proposed 22-cases [25] are taken into account to analyse the complex situations, and collision avoidance for each case is successfully demonstrated.

Integrity Check for All Modules
A sample two-ship encounter simulation is considered to check the integrity of all modules, i.e., how the modules all work together within the proposed collision avoidance system. In this study, for two ship encounters, the scale factors (SFs) for DCPA and TCPA are considered as 20 and 180, respectively. These SFs can alter the degree of risk considered by the system for a given condition, thus controlling the timing to initiate the evasion actions in the conflict resolution module. In addition, these SFs can also help the OOW to decide the minimum safety distance that he would like to consider while passing other ships. To get these SFs optimally could be a future scope of this research. However, for simplicity, at this stage, the factors are tuned manually to ensure all ships with different sizes could avoid each other with some reasonable safety margin, which is higher for big ships, and vice versa.
The system starts with a realization of the ships' initial states, which are given as user inputs. Two ships, 270.11 m LNG carrier (noted as Ship 1) and 304.65 m Tanker (noted as Ship 2), are selected for a collision course as shown in Figure 16. The initial headings and positions for these two ships are chosen to ensure a collision at (0, 0) point in the simulation domain if the ships are not taking any avoiding action. The simulation is then run for the aforementioned two ship encounter, and a successful demonstration of the avoiding action is illustrated in Figure 17, where the ships are plotted at a 300 s timestamp.    Figure 17 shows that the initial risk (CR) is 0.01 as the ships are quite far from each other. This CR and the calculated relative and encountering angle of each ship are then fed to the conflict resolution module for decision making process. Here, while taking the decision, CR is the same for both ships. However, the relative and encountering angle of ship 2 measured from ship 1 are 45 • and 90 • , whereas the same for ship 1 measured from ship 2 are 315 • and 275 • . By this way, the FIS could detect the give-way and stand-on ship and take the decision according to the COLREGs rules. In this case, ship 1 is a give way ship, whereas ship 2 is a stand on. Initially, when the CR is very low, no action is taken by the system for ship 1. However, when the CR gradually increases to 0.65, at 399 s, the module starts to order heading-change to starboard side. It starts with an angle calculated by FIS, which is updated up to 90 • (initial +45 • ) later as the CR reaches 0.89. It is mentioned that even though the system commands a particular heading for different ships, the actual heading for the same command would be different for different ships. It is usual that a big ship responds slower than a small ship due to its large mass, i.e., greater inertia force. It also depends on ships' manoeuvring characteristic. The command heading and the actual heading are plotted together in Figure 18 to understand the differences. In the case of ship 1, although the course changing command is set to 90 • , the actual course change is 76.8 • and there is a time lag to attain that course. Now, after the 90 • course command for ship 1, as the CR kept increasing, the module considers it as an extremely high-risk situation and initiates the speed reduction command at 570 s when the CR is 0.90. As the CR kept increasing even after these actions, the system finally commands the stand on ship (Ship 2) to alter its curse to 360 • (initial+45 • ) and decreases its speed at a later stage. In this avoiding process, the actual course change for ship 2 was only 324 • due to its large inertia force. Finally, both ships avoid each other at 814 s with a safety margin of 498 m. During the course alteration, as mentioned in Section 5.5., PD controller is used. The heading error and the yaw rate of each ship are fed into the controller, and the rudder command angle is calculated to put it as an input for the motion prediction module. A simple demonstration of this module is also shown at the lower part of Figure 18, where ±35 • rudder is considered as a max-min limit for the controller to take.

Verifying the System for Different Ship Types and Speeds
Two ship encountering situations are considered at the initial stage of this study to judge the feasibility of the proposed collision avoiding system. The verification is done on how the system copes with different types of ships and their corresponding speeds. Most of the published articles on collision avoidance systems concluded their work based on their preferred ship types. They barely judge their systems for different ship types and speeds. Therefore, this study would like to take the opportunity to check how the system reacts for different ship types and speeds.

The Proposed System for Different Ship Types
There are 20 different ships considered in this study, as shown in Table 1. This ranges from 43.26 m (Harbour tug) to 409.59 m (Tanker). Three different cases are investigated for different ship types, while the initial speeds, headings, and positions are kept the same. Table 4 lists up the details of the ships considered in these three case studies. Although the ships are started from the same initial states in the three cases, the CRs are expected to be calculated differently by the conflict resolution module due to different ship sizes. On the other hand, as these ships have different response rates, the conflict resolution module should also adjust the evasive actions taken by the ships depending on their dynamic response. Figures 19-21 illustrates these three cases mentioned in Table 4. For the given initial conditions, the conflict detection module considers no risk in case 1 and case 2, as the CR is less than 0, whereas, in case 3, the module considers the ships are at low risk with CR = 0.18. Later, with the time-lapse, the CR starts to increase for all three cases. However, in case 1, the module initiates the evasive action at 713 s, when the CR reaches approx. 0.65, whereas in case 2, it is at 532 s. This is because the CR reaches its medium-range value earlier in case 2 as it involves larger ships. On the other hand, case 3 involves two large ships, and the module initiated the course changing at 348 s, which is the quickest if compared with the other two cases. It demonstrates that the module has the ability to tune the risk factor, thus the timing to initiate the avoiding actions depending on the ship size. In addition, the duration while persistently holding the command for heading or speed change is not the same for the three cases. In case 3, it is much longer than case 2 and case 1. This is because a larger ship requires more time for a given course or speed change due to its larger inertia. It is also noted that the minimum ship-to-ship distance while the ships crossing each other are 48 m, 324 m, 505 m for cases 1, 2, and 3, respectively.

The Proposed System for Different Ship Speed
The system is tested for different ship speeds while keeping the ship length and the other initial conditions the same, and the ship responds differently at different speeds, demonstrating that the system can cope with that dynamic behaviour by adjusting the timing and duration of the ship evasive actions. Table 5 lists up the details of the ships considered in the following case studies. Two crossing cases are investigated for the same ship and initial conditions but with different speeds. Figures 22 and 23 illustrate the two cases mentioned in Table 5.
CRs for the above two cases are similar in nature. However, the graph is stretched in case 1 as the ships run slowly. In both cases, ship 2 (stand-on ship) maintains its course with a slight reduction in speed at the later stage when the CR attains its maximum peak. In addition, the duration while considering the course change for ship 1 is shorter in case 2 because the ships responded quickly due to having higher speed. It is also evident that the trajectories for both cases are almost identical. This means that the system has the ability to take adequate actions to guide a ship in a collision-free path, even if the speed varies.

Maximum-Course and Minimum-Speed Change Approach for Multiple-Ship Encounters
Very few researchers have attempted to verify their proposed collision avoidance system for multiple-ship encounters. A literature review revealed that existing multiple ships encounters collision avoidance models either ignore the COLREGs rules or used a preplanned or optimization path without taking ship manoeuvrability into account. Therefore, those actions are not realistic. On the contrary, this study considers ship manoeuvring indices, i.e., K and T for 20 different ships in the Nomoto's model to predict the ship motion more realistically; it also develops a Fuzzy based COLREGs rules compliant collision avoidance system. Feasibility studies of this system are then carried out for multiple ship encounters.
This research first measures the CR logically in the conflict detection module to deal with the multiple-ship encounters. It is believed that the OOW feels more threat when their ship encounters multiple ships than in a one-to-one ship encounter. Therefore, the scale factors considered in the FIS while measuring the CR are tuned to a higher value to pose a higher risk. In this study, the SF for DCPA is considered as 30 for three-ship encounters and 35 for four and five ship encounters. On the other hand, SF for TCPA is kept as before, which is 180.
The conflict resolution module is also designed to calculate the evasion actions necessary to avoid each ship. This means that each ship will have two options to choose from to avoid the other two ships in three ship encounters. Similarly, for four and five ship encounters, each ship will have three and four options, respectively. To opt for the most suitable option to avoid all the ships in an encounter, this research proposes to use a simple but effective maximum-course and minimum-speed change approach. In this approach, the system compares all available options calculated by the resolution module instantly and chooses the maximum-course and minimum-speed change command for execution. This adopted approach is then tested for complicated multiple-ship-encountering scenarios.

Simulation for Multiple Ship Encounters
At first, the proposed maximum-course and minimum-speed change strategies are tested for three ships, where ship 1 is encountering ship 2 and ship 3 from its port and starboard side, respectively, presenting two crossing situations. The initial positions, headings and speeds of the ships are selected for a collision course that would take place at (0, 0) if no actions are taken. Table 6 lists up the details of the three ships considered in the tested encounter. The simulation result is shown in Figure 24, which demonstrates that the three ships avoid each other successfully. Each ship is marked at 500 s time interval to understand the time frame of ships' avoidance action. To understand the decision-making process for this multiple ship encounter, Figures 25-27 are illustrated. Figure 25 describes the CR calculated for ship 2 and ship 3 measured from ship 1, which are noted as CR12 and CR13. For ship 1, two options are available for course changing, named Psi12 and Psi13 to avoid ship 2 and ship 3, respectively. The same goes for speed change, where the options are u12 and u13. According to the strategy, the course changing options are compared at each time, and the maximum value is selected. For example, because Psi 13 is zero, Psi 12 is chosen for ship 1. On the other hand, u12 and u13 are compared for minimum speed change, and thus u13 is preferred. Figure 26 describes the details for ship 2 while taking evasive action. Here the options are highlighted by denoting the parameters as 21 and 23, which means the actions to be taken by ship 2 to avoid ship 1 and ship 3, respectively. Here, ship 2 chooses Psi21 and u12 as its avoiding action. For ship 3, the system chooses Psi31 and u31 as its avoiding action, the details of which can be found in Figure 27.
To increase the complexity, four and five-ship encounters are also tested. Table 7 shows the details of the extra two ships added into the three-ship encounters to judge the system's effectiveness for four and five ship encounters.    Figures 28 and 29 demonstrate the simulation results of these two cases, respectively. For ease of comparison, the initial states and the ships are considered as the same. The trajectories of the ships are demonstrated at 500s timestamp as well. Despite the fact that in both figures the ships avoid each other successfully, the actions taken by the ships to avoid each other must be analysed properly. For ship 1, the course changing pattern is much the same in both figures. However, Ship 2 initiates its starboard turn at an earlier stage to avoid Ship 5, as shown in Figure 29. Regarding ship 3, a slight variation in course changing command does exist, but it does not affect its course changing pattern much. For ship 4, the actions for course changing command are identical, whereas it runs at a reduced speed for quite a long time in five ship encountering situations. On the other hand, ship 5 takes a large starboard turn to avoid all ships in its course.  A number of similar cases are analysed in this study and found the ships are avoiding each other successfully. In order to consider a higher level of complexity, this study also attempts to solve Imazu-proposed 22 encountering cases, and the results are included in the following subsection.

The Proposed System to Solve Imazu Problems
Imazu problem [25] is chosen as a benchmark in this study. This problem consists of basic ship encounters of one on one and other difficult situations of multiple ship encounters. Figure 30 shows the 22 problems defined by Imazu, where numbers on the top left corner in each box indicate the case number. The short bar from the triangle and circle indicates the velocity vector of the ships. These 22 cases are tested with the proposed system and the maximum-course and minimum-speed change approach. The results are shown in Figure 31.   The ship types are randomly selected from Table 1  To demonstrate the timestamp of the ships' evasive actions, two samples from Figure 31, case 20 and case 21, are chosen and shown in Figure 32. The integers in Figure 32 define the ship positions at 500 s interval, giving a clear understanding of how the system manages to guide all the ships to pass each other by maintaining a proper safety distance. Finally, all these results show that the system is tolerant enough to consider more ships in any encountering situation proposed by Imazu. This study has analysed up to five ships in an encounter, which could be increased in future studies.

Conclusions and Future Studies
This study proposes a Fuzzy logic based novel collision avoidance system which not only takes care of the COLREGs rules while taking the evasive actions but also considers the ship dynamic. In this regard, the key input parameters are carefully selected, and the corresponding fuzzy membership functions are appropriately designed. COLREGs and the expert knowledge are unitized while defining the fuzzy rules to make the system COLREGs complaint. Later, the effectiveness of the proposed system is demonstrated for a simple one-to-one to complicated multiple ships encounters. Furthermore, a unique but straightforward effective maximum-course and minimum-speed change approach is also introduced for this system while dealing with the decision-making processes for multiple-ship encounters.
To summarize: • This research utilizes Nomoto's equation in the motion prediction module to consider the ship dynamic and to predict the ship motion more realistically. Twenty different ships' manoeuvring indices, i.e., K and T, are considered to distinguish the ship motion from each other. • Closest point of approach (CPA) is considered in the conflict detection module, but, unlike others, the DCPA and TCPA are non-dimensionalised by using the largest ship size and relative velocities in an encounter. This allows the system to consider ship size and speed effect and tune the risk value accordingly. Fuzzy membership functions are then designed for these two inputs, and Fuzzy rules are selected. To manipulate the risk for a higher number of ship encounters, scale factors (SF) are used to normalise the membership functions. These SFs are selected manually to ensure a safe crossing distance for up to five ship encounters at this stage of research.

•
The calculated risk (CR) from the conflict detection module and the encountering and relative angle of each ship measured from others are then used to construct a Fuzzy based conflict resolution module. Based on the types of encounters, the relative position measured from each ship is divided into seven parts. Then, for a different combination of encountering and relative angle, the COLREGs compliant rules are defined.

•
The conventional PD controller and speed response equation are chosen as a course and/or speed change module. • After carefully designing the modules, their integrity is tested for different ship encountering situations and found successful. The system is also verified for different ship types, sizes, and speeds. • A simple but effective maximum-course and minimum-speed change approach is introduced for multiple ship encounters while selecting the evasive action from multiple available options by the system. • Imazu problem is set as the benchmark in this study, and the proposed system has been found to give an effective and realistic solution for each of 22 cases maintaining the COLREGs rules.

•
The system is also tested for different complex encountering scenarios with up to five-ship encounters and found successful.
Despite the proposed system works effectively to avoid ship collisions in any complicated multiple ship encountering situation, further improvements can still be carried out, for example:

•
In the current study, the system assumes that all ships are aware of each other's state and will take necessary steps to avoid each other. However, a ship might not be aware of other ship's actions in a real situation, or it just avoids taking any action believing that other ships should take the lead. Those cases need to be investigated to check whether the system can guide others ships to avoid a non-commanding ship.

•
The system needs to be investigated for sensor noise tolerance before doing the test run in the near future.

•
Environmental disturbances such as current and wind effects have not been considered yet in the system. It would be interesting to see whether the proposed system could successfully guide the ships to avoid each other under such conditions. • The scale factors for the DCPA and TCPA are chosen manually at this stage, which can be automated and optimized for better results.

•
This study considers up to five-ship encounters. A greater number of ships could be considered in the near future to increase the complexity of the system.