Skip to content

vessel_performance_modeller

VesselPerformanceModeller(env_mesh_json, vessel_config, custom_vessel=None)

Class for modelling the vessel performance. Takes both an environmental mesh and vessel config as input in json format and modifies the input mesh to include vessel specifics.

Parameters:

Name Type Description Default
env_mesh_json dict

a dictionary loaded from an environmental mesh json file

required
vessel_config dict

a dictionary loaded from a vessel config json file

required
custom_vessel class

a custom vessel object that specifies a set of performance and accessibility models

None

filter_nans()

Method to check for NaNs in the input cell boxes and zero them if present

get_all_neighbours(cell_id)

Method to get a list of all neighbouring cell ids for a particular cell within the environmental mesh

Parameters:

Name Type Description Default
cell_id str

Cell ID to find the neighbours around

required

Returns: neighbours (list): List of IDs of neighbouring cells

model_accessibility()

Method to determine the accessibility of cells in the environmental mesh and remove inaccessible cells from the neighbour graph.

model_performance()

Method to calculate the relevant vessel performance values for each cell in the environmental mesh and update the mesh accordingly.

split_neighbouring_cells(inaccessible_nodes)

Method to split any accessible cells that neighbour inaccessible cells until their sizes match

Parameters:

Name Type Description Default
inaccessible_nodes list

List of inaccessible nodes to split around

required

to_json()

Method to return the modified mesh in json format.

Returns:

Name Type Description
j_mesh dict

a dictionary representation of the modified mesh.