simulate_vessel: Simulate a set of vessel transits on a spatial grid

View source: R/simulate_vessel.R

simulate_vesselR Documentation

Simulate a set of vessel transits on a spatial grid

Description

This function is deprecated but may still be useful in some contexts.

Usage

simulate_vessel(grids, vessels, toplot = TRUE, verbose = TRUE)

Arguments

grids

A spatial grid of cells, as produced by shipstrike::make_grid() (see documentation) (or at least matching the format thereof).

vessels

A list of lists, each one representing settings for the simulation of a set of vessel transits. The expected format of each list is as follows:

  • type A chatacter string name for this type of vessel, whatever you want: e.g., "fishing", "tanker", etc.

  • n A numeric indicating the number of transits to simulate.

  • size_min Minimum vessel size (meters)

  • size_max Maximum vessel size (meters); for each transit, a size will be drawn from a uniform-random distribution between the min and the max.

  • speed_min Minimum vessel speed (knots)

  • speed_max Maximum vessel speed (knots); as with size, the speed of each transit will be drawn from a uniform random distribution between the min and the max.

  • width A scaling factor, between 0 and 1, used to scale the length of the vessel to get its beam width. Typical values for a large ship range from 0.05 to 0.15.

  • draft A scaling factor, between 0 and 1, used to scale the length of the vessel to get its draft. Typical values are somewhere between 0.03 and 0.10.

  • hour The hour of day on which to begin the transit; if not provided or NULL, a random start hour will be chosen.

  • months The months of year in which to simualte transits; if nothing is provided, or if NULL, the month for each transit will be randomly chosen. This can be handy if you want to simulate the effects of adding vessel traffic at only certain times of year. Regardless of whether month is specified, the day of month for each transit is then randomly chosen.

  • direction A means of alternating or reversing the direction transited along the vessel's course; ignored if course below is NULL. If direction is 0 or NULL or missing, the vessel always travels along the course in the sequence indicated within the course data.frame, starting at the first pair of coordinates. If direction is 1, the course will be reversed. If direction is 2, the course direction will alternate randomly.

  • course_var A means of adding minor variation to the course data.frame provided below; will be ignored if course is missing or NULL. The argument course_var accepts a small numeric (typically less than 0.005, for reasonable results), representing degrees latitude; that number will be used to offset the course coordinates by rnorm(1, mean=0, sd=course_var) in both the north-south and east-west directions.

  • course A data.frame of coordinates, representing the planned route for this group of vessels. If provided, it must have two columns: x (longitude, decimal degrees in which West is negative) and y (latitude, decimal degrees in which South is negative). If not provided, the route will be randomly created as a linear line crossing the spatial grid.

toplot

A Boolean; if TRUE, progress plots will be shown.

verbose

A Boolean; if TRUE, updates will be printed to the Console.

Value

A data.frame, in which each row is a position fix for a transiting vessel, with the following columns:

  • vid = A fake ID for the vessel

  • type = Vessel type

  • speed = Speed, in knots

  • length = Length

  • width = Beam width

  • draft = Draft

  • datetime = Datetime in UTC, with format ⁠yyyy-mm-dd hh:mm:ss⁠.

  • x = Longitude, decimal degrees (Western degrees negative).

  • y = Latitude, decimal degrees (Southern degrees negative).

  • km = The distance, in kilometers, between this and the next position fix.


ericmkeen/shipstrike documentation built on May 21, 2023, 7:05 a.m.