<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Southampton, United
Kingdom</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>ASVTrafficSim: A simulator for Autonomous Surface Vehicle and Manned Vessel Collisions</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Colin Sauze Department of Computer Science Aberystwyth University Penglais Aberystwyth Ceredigion United Kingdom SY23 3DB</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <volume>3</volume>
      <fpage>1</fpage>
      <lpage>08</lpage>
      <abstract>
        <p>At present there is only limited data about the probability of collisions between autonomous surface vehicles (ASVs) and manned vessels. This paper describes a simulator for calculating the probability of collisions between them. It is intended to help formulate safety advice and policy on where and when ASVs can and can't be safely used. The simulator tests hypothetical courses of the ASV against real traffic data recorded from automatic identification system (AIS) transponders. This allows simulated missions to be tested against real world traffic patterns. The simulator has successfully simulated example missions using a small set of example AIS data based in San Francisco bay. Future work will involve running simulations from large AIS datasets and with a variety of ASV types, as well as covering differing weather scenarios.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Copyright c by the paper’s authors. Copying permitted for private and academic purposes.
1.1</p>
      <p>AIS
AIS transponders broadcast the boat’s maritime mobile service identity (MMSI), position, heading, speed, rate
of turn every few seconds over a VHF radio link. AIS is required by all manned vessels over 300 gross tonnes,
with many smaller vessels also opting to use the system. Less frequently sent messages can also include the ship’s
destination, name and dimensions. Two classes of AIS transmitter are available, class A and class B. Class A is
intended for commercial traffic and transmits at higher power (12.5W) and more frequently, its typical range is
around 40 nautical miles (Marine Management Organisation, 2014). The lower power class B system is intended
for pleasure craft and only uses 2 watts of transmission power and transmits less frequently, its typical range is
around 10 nautical miles(Marine Management Organisation, 2014). This lower power and frequency combined
with many smaller boats still not being equipped with AIS mean that data for small craft is often lacking.</p>
      <p>
        A number of internet linked shore receivers pass on data to web services such as MarineTraffic
        <xref ref-type="bibr" rid="ref2 ref5">(Marine Traffic,
2018)</xref>
        and
        <xref ref-type="bibr" rid="ref1">AISHub (AISHub, 2018</xref>
        ). In recent years satellite based reception has also become increasingly
common, allowing sites like MarineTraffic to cover traffic out of range from shore. Analysis of shipping patterns
from AIS data has become increasingly common
        <xref ref-type="bibr" rid="ref7">(Ristic et al., 2008)</xref>
        <xref ref-type="bibr" rid="ref3">(Fiorini et al., 2016)</xref>
        . One common output of
these analyses is traffic density maps which show a generalised view of how busy an area is. MarineTraffic
        <xref ref-type="bibr" rid="ref2 ref5">(Marine
Traffic, 2018)</xref>
        , the US Coastguard
        <xref ref-type="bibr" rid="ref2">(Beuaru of Ocean Energy Management, 2018)</xref>
        and UK government(Marine
Management Organisation, 2014) are amongst those publishing density maps. Although these density maps can
form a useful tool in planning ASV operations they are relatively crude and often lack time of day, day of week
or time of year specific information. ASVTrafficSim aims to provide more a detailed and specific view of the
risks involved with travelling a given route.
1.2
      </p>
      <sec id="sec-1-1">
        <title>AIS Data Sources</title>
        <p>
          To test against real traffic patterns a source of AIS data was needed. There are a number of commercial
sources of AIS data, however the cost of obtaining raw data from these was prohibitively expensive and not an
option for this research. Several free alternatives were identified. The Marine Cadstre
          <xref ref-type="bibr" rid="ref2">(Beuaru of Ocean Energy
Management, 2018)</xref>
          from the US Coastguard offers a large amount of AIS data, but this is formatted for the
commercial ArcGIS software and is difficult to read without ArcGIS. Several volunteer run networks make data
freely available online. These include
          <xref ref-type="bibr" rid="ref1">AISHub (AISHub, 2018</xref>
          ) and aprs.fi. The data on aprs.fi was found to
be lacking in coverage and there don’t appear to be many AIS receivers in their network. AISHub operates an
exchange where free access to data is given in return for contributing data. At time of writing the author has not
setup a receiver capable of contributing to AISHub, but intends to do so in future. The Exploratorium Museum
in San Francisco operates a receiver on the San Francisco seafront that continuously streams raw data to their
website (ais, a). Greenpeace have a collection of 1.2 million messages taken over two days in 2014 is available
from their github page (ais, b). This data is in raw NMEA format and can be decoded using the open source
LibAIS
          <xref ref-type="bibr" rid="ref9">(Schwehr, 2015)</xref>
          software.
2
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>ASVTrafficSim</title>
      <p>
        ASVTrafficSim is an open source tool written in Python, it is available from
        <xref ref-type="bibr" rid="ref8">(Sauze, 2018)</xref>
        . It simulates sailing
of a target route using the open source Sailsd simulator
        <xref ref-type="bibr" rid="ref10">(Taylor, 2016)</xref>
        which has a reasonably accurate physics
model based upon work by
        <xref ref-type="bibr" rid="ref4">(Jaulin and Le Bars, 2012)</xref>
        . The autopilot logic for controlling Sailsd operates through
Boatd, another open source tool for presenting an HTTP and JSON based interface to an ASV. Output from
Boatd is sent over a UDP datastream in the form of NMEA0183 GPS strings, these are received and processed
by ASVTrafficSim’s collision detector which uses them to establish the ASV’s current location. Upon starting
ASVTrafficSim loads a datafile of AIS messages and parses these with LibAIS, extracting each report’s Maritime
Mobile Service Identity (MMSI), ship name (where given), latitude, longitude and time. This data was then used
to test for collisions at the simulated time and location. Figure 1 shows how these components are integrated
and communicate with each other.
      </p>
      <p>AIS data is interpolated between data points on a 1 second basis. Typically class A AIS data is transmitted
every few seconds, so there is relatively little error in the interpolation. However class B messages are less
frequent, typically being 10s of seconds apart and due to the lower power they are often not received as easily by
shore stations. The linear interpolation was limited to a maximum of 15 minutes so that boats which are moored
and have switched off their AIS aren’t projected as continuing to travel. This linear interpolation method will
not be completely accurate as it only uses the last heading and speed and ignores if the boat was rotating. A
small improvement to the accuracy of class B interpolation might also be possible using polynomial interpolation
instead of linear interpolation.</p>
      <p>The Sailsd simulator operates on a realtime basis, to maintain realism ASVTrafficSim also does this. Each
second that time advances in Sailsd corresponds to one second in AIS data of ship movements. This does have
the disadvantage of simulations taking a long time to run. Ship movements are linearly interpolated between
data points in the AIS data and these are generated on a second by second basis. At each one second iteration the
position of every ship is compared with the position of the simulated ASV. Ideally collisions could be calculated by
looking at the ship’s dimensions and working out if it overlapped with the ASV. Unfortunately the Exploratorium
AIS dataset is missing any messages covering boat dimensions. Therefore any ship getting within 10 metres of
the ASV is considered to be a collision and 100 metres a near miss. All collisions and near misses are recorded
and saved by the output map generator. This saves data into a GPX file along with the ship and ASV tracks.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>A simulated course was setup to sail a square around Alcatraz Island in San Francisco harbour, the simulation
was set to use a northerly wind requiring upwind tacking on the northbound leg of the course. This crosses busy
shipping channels in and out of San Francisco bay, tourist boat traffic going to and around the island and ferries
operating from the city centre. The course taken on this route is shown in figure 2. The 2014 Exploratorium
dataset from the Greenpeace was used to supply traffic information. The simulation run took place between
12:40 and 14:53 UTC (4:40 and 6:53 PST) on November 26th 2014. These times represent the start of the AIS
dataset. 10 laps of the course were completed in this time.</p>
      <p>In running this simulation for just over two hours, there were two collisions and 69 near misses. All of these
were with the ferry Zelinsky which operates tours around the island. Both of the collisions occurred when the
boats were less than 10 metres apart over the course of two seconds. The near misses are clustered into two
areas, one on the western side of the course where both boats were sailing in parallel and very closely. The others
are either side of the point where the collision occurred. Figure 3 shows a map of this output, with the near
misses marked as triangles and the collisions as circles.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>This work demonstrates the viability of ASVTrafficSim for detecting potential collisions. It allows fine grain
identification of which vessels a collision occurred with or came close to occurring with. This is particularly
valuable when planning routes in areas with regular traffic such as ferries. By running multiple simulation runs
with differing start times or route predictions over wider areas can also be obtained.</p>
    </sec>
    <sec id="sec-5">
      <title>Future Work</title>
      <p>Future work will involve improving the usability and accuracy of ASVTrafficSim. Usability could be improved so
that a user can simply input the parameters of their USV and intended course and then receive a report showing
the collisions and near misses. Currently the user must start five different programs to run the simulation,
although Docker and Singularity containers are available to simplify this. Run times could be reduced by
removing the real time nature of the simulator and running at faster than real time. At present the physics
model available within Sailsd is still somewhat unrealistic. More fine tuning of its parameters is required to
match the performance of a real USV. It does not include the effects of sea state, tides, currents or simulate any
variations in the wind. A more realistic simulation could be achieved by including these variables. Tides are of
particular importance given how small ASVs are often unable to travel fast enough to fight against strong tides.
To give a clearer idea of the probability of a collision a monte carlo method could be used with the simulation
being repeated many times with small random variations in weather conditions or the course being sailed.</p>
      <p>
        The use of larger AIS datasets will also help to improve the range of simulations which can be run and the
geographic areas which can be tested. Obtaining AIS data remains an obstacle, although commercial providers
of such data exist their prices are prohibitively expensive.
        <xref ref-type="bibr" rid="ref1">AISHub (AISHub, 2018</xref>
        ) is a potential alternative to
this as they will provide access to data from their network in exchange for contributing a receiver. Alternatively
datasets could be generated by setting up receivers comparable to the one used by the Exploratorium.
      </p>
      <sec id="sec-5-1">
        <title>Acknowledgements</title>
        <p>The author would like to thank Louis Taylor with his help with getting Boatd and Sailsd to work with this
project. We acknowledge the support of the Supercomputing Wales project, which is part-funded by the European
Regional Development Fund (ERDF) via Welsh Government.</p>
        <sec id="sec-5-1-1">
          <title>AIS Exploratorium. http://ais.exploratorium.edu (Accessed Aug 2nd 2018).</title>
        </sec>
        <sec id="sec-5-1-2">
          <title>AISHub (2018). AIS Data Exchange. http://www.aishub.net (Accessed Aug 2nd 2018). Beuaru of Ocean Energy Management (2018). Marine cadastre national viewer. https://marinecadastre.gov/ nationalviewer/ (Accessed Aug 2nd 2018). Fiorini, M., Capata, A., and Bloisi, D. D. (2016). AIS data visualization for maritime spatial planning (msp).</title>
          <p>Marine Management Organisation (2014). Mapping UK shipping density and routes from AIS.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>AIS Exploratorium Data - November</surname>
          </string-name>
          26th-27th
          <year>2014</year>
          . https://github.com/greenpeace/oceansofdata/tree/ master/ais-exploratorium
          <article-title>-edu (Accessed Aug 2nd</article-title>
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <article-title>Beuaru of Ocean Energy Management (</article-title>
          <year>2018</year>
          ).
          <article-title>Marine cadastre national viewer</article-title>
          . https://marinecadastre.gov/ nationalviewer/ (Accessed Aug 2nd
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Fiorini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Capata</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Bloisi</surname>
            ,
            <given-names>D. D.</given-names>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>AIS data visualization for maritime spatial planning (msp)</article-title>
          .
          <source>International Journal of e-Navigation and Maritime Economy</source>
          ,
          <volume>5</volume>
          :
          <fpage>45</fpage>
          -
          <lpage>60</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Jaulin</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Le Bars</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          (
          <year>2012</year>
          ).
          <article-title>A simple controller for line following of sailboats</article-title>
          .
          <source>In proceedings of the 5th International Robotic Sailing Conference</source>
          , Cardiff, United Kingdom,
          <year>September 2012</year>
          , pages
          <fpage>117</fpage>
          -
          <lpage>129</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Marine</given-names>
            <surname>Traffic</surname>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>Global ship tracking intelligence</article-title>
          . http://www.marinetraffic.
          <source>com (Accessed Aug 2nd</source>
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <given-names>National</given-names>
            <surname>Oceanic and Atmospheric Administration</surname>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>ENC chart US5CA13M: San francisco bay candlestick point to angel island</article-title>
          . http://www.charts.noaa.gov/ENCs/Agreement.shtml?
          <article-title>US5CA13M (Accessed Aug 2nd</article-title>
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Ristic</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scala</surname>
            ,
            <given-names>B. L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morelande</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Gordon</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          (
          <year>2008</year>
          ).
          <article-title>Statistical analysis of motion patterns in AIS data: Anomaly detection and motion prediction</article-title>
          .
          <source>In 2008 11th International Conference on Information Fusion</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Sauze</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          (
          <year>2018</year>
          ). ASVTrafficSim. https://github.com/colinsauze/ASVTrafficSim (Accessed Aug 2nd
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Schwehr</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          (
          <year>2015</year>
          ). LibAIS. https://github.com/schwehr/libais (Accessed Aug 2nd
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Taylor</surname>
          </string-name>
          , L. (
          <year>2016</year>
          ).
          <article-title>Sails simulator: A set of tools for robotic sailing boat simulation</article-title>
          . https://github.com/ sails-simulator (
          <issue>Accessed Aug 2nd</issue>
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>