## 3 Description of Data Integration Algorithm  
This algorithm's inputs are Multi-Radar Fusion Track (MRFT) points and AIS data. MRFT points (MRFTP) are the product of a multi-radar multi-target tracking algorithm and represent current positions of vessels observed by the network of HFSWRs. Every MRFT is defined by its identification number--ID number, while AIS data have their unique identifiers--Maritime Mobile Service Identity (MMSI) [21]. Output of the proposed algorithm is a set of unique data pairs (AIS MMSI, MRFT ID number) that are considered to originate from the very same vessel. Since, matching of the  
Figure 1: High frequency surface-wave-radar (HFSWR) network coverage area. aforementioned pairs is never 100% accurate, for every data pair, the probability of matching is calculated. Based on this probability the final decision is made. The proposed algorithm is triggered by reception of a new MRFTP list and so-far collected AIS messages. MRFTP dataflow is periodic with regular repetition cycles (33 s). On the other hand, AIS message dataflow is chaotic, with great uncertainty in timing of message delivery, especially in the case of Satellite AIS transmissions, where message deliveries could have delays measured in hours. Such behavior implies that, in order to perform matching of AIS data with MFRTs, 8 h of deep history records for every MRFT and AIS must be kept. Steps of the proposed algorithm are shown in Figure 2.  
* creating new entries for MMSIs which are reported for the first time,
* refreshing data for already existing AIS data-MRFT pairs, if it is possible and
* cleaning up old and unneeded data. During the second step the algorithm is searching for a set of suitable MRFT integration candidates for each AIS data source. \"This search\" is shown in Figure 3.  
Figure 2: Steps of automatic identification system-multi-radar fusion track (AIS-MRFT) integration algorithm (taken from [14]). In the first step, the algorithm is conducting the following operations. First, the algorithm checks all currently active MRFTPs in order to find the ones with a timestamp close to that of the AIS data. If this cannot be achieved, the algorithm tries to load MRFTs from its history in order to find those MRFTPs close to the AIS timestamp. If this, cannot be achieved, the AIS position is extrapolated. Extrapolation is done with the data provided by AIS under the assumption that the vessel did not change its course and speed. In this way, the AIS position is translated to the current time. Next, the gate radius needs to be checked. Those MRFTs which pass both checks (timestamp and gate radius) are considered to be candidates for the integration. Please note that it is possible that one AIS data has multiple MRFT integration candidates and vice versa. All those MRFTs which did not pass previous checks are considered unsuitable for integration with observed AIS data. If MRFT is considered unsuitable for integration N consecutive times, observed MRFTs shall never again be considered for integration with the observed AIS track. In this way, the algorithm cuts unnecessary operations and this speeds up future processing. In the third step, for each candidate pair, the matching factor is calculated. The matching factor (\(M\)) represents the likelihood that the observed pair of data originates from the same vessel. It consists of speed and course matching factors, Equation (1). \[M=Mv\times Mc \tag{1}\]  
where \(Mv\) and \(Mc\) represent speed and course matching coefficients for the candidate pair. The speed matching coefficient is defined with Equations (2) and (3), while the course matching coefficient for the candidate pair is defined with Equations (4) and (5). \[v_{diff}=|v_{AIS}-v_{MRFT}| \tag{2}\]  
\[M_{v}=1-\frac{v_{diff}}{\textit{greater\_of}(v_{AIS},v_{MRFT})} \tag{3}\]  
where \(v_{AIS}\) and \(v_{MRFT}\) represent the vessel's speed reported by AIS and the HFSWR network respectively, while \(v_{diff}\) is their difference.