## 3 Description of the Employed Simulator  
The viability and performance of the system were checked with a simulation of its operation using AIS data on maritime traffic from the years 2018, 2019, and 2020. In this way, we started with a sufficiently representative and updated sample. These data were processed and stored in a database to permit working with them. AIS data included a timestamp indicating when the vessel was identified. The frequency of identification per vessel was 30 min. Therefore, in order to carry out the simulation, the AIS data were grouped into 30-min time slots. This entailed small deviations on the real situation of the vessels at a specific moment, but due to their speed and the size of the squares proposed for the system, these deviations are negligible. Figure 4: Block diagram of the system proposed for installation on board (AVISOMEF + Maritime Communication Network on Medium Frequency). The ship is assumed to be in the first cell, which is located to the left of the grid depicted in Figure 1. The receivers E and F operate in the upper grid of the same cell. The transmitter works for both AVISOMEF and the Communication Network simultaneously. For example, a vessel with an AIS positioning with a timestamp of 12 August 2020 12:03:14 and another one of 12 August 2020 12:14:17 were in the same time slot during the simulation. As we did not have the localization of the two ships at the same moment, we placed them, approximately, in a range of 30 min in a specific cell of the system. It is important to highlight that this is the only way to work with this type of data, since it is not possible to have AIS data of the same moment of all the vessels. To carry out the simulation [22], two complementary programmes were developed: (1) a programme with a graphical interface that allows for the design of the Communication System, locating all of its elements geographically and visualizing the maritime traffic in a specific time slot and (2) another programme that takes as input the system proposed by the first program and performs its simulation. The second program does not have a graphical interface and was optimized to be able to work with the large amount of data available. The first programme was implemented as a Geographic Information System (GIS). It allows you to load AIS data from the database of two specific dates [23; 24; 25]. A grouped display of all these data can be completed in specific time slots of 30 min on the OpenStreetMap cartography [26; 27]. Once the maritime traffic data has been loaded, it is possible to properly locate the necessary elements for the operation of the System: Traffic Control Centres and grids. The program allows for working with these elements in various ways: add, delete, associate Traffic Control Centres and grids, change their colour to facilitate the interpretation of the system approach, merge two grids to allow the change of direction, etc. Once the design is finished, the System can be exported to a file that can be opened with this first program or can be used as input to the second. The second programme receives as input a file with the representation of a system to be simulated and is in charge of obtaining the number of communication channels and the length of each of them every 30 min. To obtain these data, the proposed Algorithm 1 is as follows:  
```
1:forach Traffic Control Centre
2:forach Grid
3:Cell_init \(\leftarrow\)Cell_last
4:whileCell_index differentCell_first + 1
5:Channel \(\leftarrow\)Empty
6:fromCell_index \(\leftarrow\)Cell_init toCell_first
7:if there are vessels inCell_index
8:Channel \(\leftarrow\)addCell_index
9:Remove vessel fromCell_index
10:else
11:Cell_init \(\leftarrow\)Cell_index \(-\)1
12:ifChannel is complete
13:Num_channels + 1
14:Channel_length \(\leftarrow\)Number of vessels in Channel
15:Generate output data for Grid
```  
**Algorithm 1** Simulation Algorithm: Number and Length of Channels. The algorithm (Algorithm 1) tries to form far-reaching communication channels within the corresponding grid.