trafficgen.read_files module
Functions to read the files needed to build one or more traffic situations.
- trafficgen.read_files.camel_to_snake(string: str) str [source]
Convert a camel case string to snake case.
- trafficgen.read_files.check_input_units(data: Dict[str, Any]) Dict[str, Any] [source]
Check if input unit is specified, if not specified it is set to SI.
- trafficgen.read_files.convert_keys_to_snake_case(data: Dict[str, Any]) Dict[str, Any] [source]
Convert keys in a nested dictionary from camel case to snake case.
- trafficgen.read_files.convert_settings_data_from_maritime_to_si_units(settings: EncounterSettings) EncounterSettings [source]
Convert situation data which is given in maritime units to SI units.
- Params:
own_ship_file: Path to the own_ship_file file
- Return type:
* own_ship information
- trafficgen.read_files.convert_situation_data_from_maritime_to_si_units(situation: SituationInput) SituationInput [source]
Convert situation data which is given in maritime units to SI units.
- Params:
own_ship_file: Path to the own_ship_file file
- Return type:
* own_ship information
- trafficgen.read_files.read_encounter_settings_file(settings_file: Path) EncounterSettings [source]
Read encounter settings file.
- Params:
settings_file: Path to the encounter setting file
- Returns:
* encounter_settings
- Return type:
Settings for the encounter
- trafficgen.read_files.read_generated_situation_files(situation_folder: Path) List[TrafficSituation] [source]
Read the generated traffic situation files. Used for testing the trafficgen algorithm.
- Params:
situation_folder: Path to the folder where situation files are found
- Returns:
* situations
- Return type:
List of desired traffic situations
- trafficgen.read_files.read_own_ship_static_file(own_ship_static_file: Path) ShipStatic [source]
Read own ship static data from file.
- Params:
own_ship_file: Path to the own_ship_static_file file
- Return type:
* own_ship static information
- trafficgen.read_files.read_situation_files(situation_folder: Path) List[SituationInput] [source]
Read traffic situation files.
- Params:
situation_folder: Path to the folder where situation files are found
input_units: Specify if the inputs are given in si or maritime units
- Returns:
* situations
- Return type:
List of desired traffic situations
- trafficgen.read_files.read_target_ship_static_files(target_ship_folder: Path) List[ShipStatic] [source]
Read target ship static data files.
- Params:
target_ship_folder: Path to the folder where target ships are found
- Returns:
* target_ships_static
- Return type:
List of different target ships with static information