Class MaritimeSubsystem
- Namespace
- NominalSystems.Maritime
- Assembly
- NominalSystems.Maritime.dll
The vessel subsystem is able to keep track of vessels and manage the AIS integration for the vessels and messages.
public class MaritimeSubsystem : SimulationSystem
- Inheritance
-
MaritimeSubsystem
- Inherited Members
Constructors
MaritimeSubsystem()
Basic constructor for the vessel system
public MaritimeSubsystem()
Properties
Count
[-] The total number of vessels loaded into the system
public int Count { get; }
Property Value
Methods
Connect(string)
Create the connection with the AIS integration and update the API key of the connection.
public void Connect(string apiKey)
Parameters
apiKey
stringThe API key for the AIS integration
GetCachedVessels()
Returns the list of vessels that have been created since the last update of vessels. It then removes the vessels from the cache.
public Vessel[] GetCachedVessels()
Returns
- Vessel[]
A list of vessels that have been added since the most recent update
GetVessel(int)
Returns the vessel that matches the MMSI ID value that was passed in.
public Vessel? GetVessel(int id)
Parameters
id
int[-] The MMSI ID
Returns
- Vessel
A vessel object if it exists
GetVessels()
Returns the list of vessels from the Maritime subsystem of all tracked vessels.
public List<Vessel> GetVessels()
Returns
OnFinish(double)
Called when the 'SimulationSystem' is finishing
protected override void OnFinish(double time)
Parameters
time
doubleelapsed time (seconds)
RequestData(GeodeticElements?, GeodeticElements?, int, double)
Requests AIS data from the integration with the system and loads some new vessels. This will return the IDs of all the new vessels that were created, if they exist.
public int[] RequestData(GeodeticElements? minimumCoordinates = null, GeodeticElements? maximumCoordinates = null, int vessels = 100, double timeout = 10)
Parameters
minimumCoordinates
GeodeticElements[deg] The minimum coordinates of the grid
maximumCoordinates
GeodeticElements[deg] The maximum coordinates of the grid
vessels
int[-] The number of vessels to fetch
timeout
double[s] The timeout to wait for a connection with the AIS system
Returns
- int[]
[-] The list of vessel IDs that were created from this call
RequestDataAsync(GeodeticElements?, GeodeticElements?, int, double)
[ASYNC METHOD] Requests AIS data from the integration with the system and loads some new vessels. This will return a number of vessels within a desired coordinate range.
public Task RequestDataAsync(GeodeticElements? minimumCoordinates = null, GeodeticElements? maximumCoordinates = null, int vessels = 100, double timeout = 10)
Parameters
minimumCoordinates
GeodeticElements[deg] The minimum coordinates of the grid
maximumCoordinates
GeodeticElements[deg] The maximum coordinates of the grid
vessels
int[-] The number of vessels to fetch
timeout
double[s] The timeout to wait for a connection with the AIS system
Returns
- Task
[-] An asynchronous task
RequestDataAsync(GeodeticElements?, GeodeticElements?, string[]?, string[]?, int, double)
[ASYNC METHOD] Requests AIS data from the integration with the system and loads some new vessels. This will attempt to create the vessels from the data that is returned.
public Task RequestDataAsync(GeodeticElements? minimumCoordinates = null, GeodeticElements? maximumCoordinates = null, string[]? messages = null, string[]? ids = null, int vessels = 100, double timeout = 10)
Parameters
minimumCoordinates
GeodeticElements[deg] The minimum coordinates of the grid
maximumCoordinates
GeodeticElements[deg] The maximum coordinates of the grid
messages
string[][-] A list of message types to filter by
ids
string[][-] A list of MMSI vessel IDs to filter by
vessels
int[-] The number of vessels to fetch
timeout
double[s] The timeout to wait for a connection with the AIS system
Returns
- Task
[-] An asynchronous task
RequestVessel(int, double)
Requests the data for a particular vessel and updates the data if it does exist.
public bool RequestVessel(int mmsi, double timeout = 10)
Parameters
mmsi
int[-] The unique MMSI ID for the vessel
timeout
double[s] The timeout before the application continues the thread
Returns
- bool
[-] A flag whether the vessel was created correctly