trafficgen.write_traffic_situation_to_file

Functions to clean traffic situations data before writing it to a json file.

Functions

convert_ship_data_from_si_units_to_maritime(ship)

Convert ship data which is given in SI units to maritime units.

convert_situation_data_from_si_units_to__maritime(...)

Convert situation data which is given in SI units to maritime units.

write_traffic_situations_to_json_file(...)

Write traffic situations to json file.

trafficgen.write_traffic_situation_to_file.convert_ship_data_from_si_units_to_maritime(ship: T_ship) T_ship

Convert ship data which is given in SI units to maritime units.

Parameters:

ship (T_ship) – Ship data

Returns:

ship – Converted ship data

Return type:

T_ship

trafficgen.write_traffic_situation_to_file.convert_situation_data_from_si_units_to__maritime(situation: TrafficSituation) TrafficSituation

Convert situation data which is given in SI units to maritime units.

Parameters:

situation (TrafficSituation) – Traffic situation data

Returns:

situation – Converted traffic situation data

Return type:

TrafficSituation

trafficgen.write_traffic_situation_to_file.write_traffic_situations_to_json_file(situations: list[TrafficSituation], write_folder: Path) None

Write traffic situations to json file.

Parameters:
  • traffic_situations (list[TrafficSituation]) – List of traffic situations to be written to file

  • write_folder (Path) – Path to the folder where the json files is to be written