Skip to content

Suggestion: add overloaded generate_traffic_situation function to pass in data structures (not files) #82

Description

@StephanieKemna

Use case; if you wanna generate a traffic situation from another piece of code, but wanna pass in the settings as a struct/dict/data and not as files.
I have done this in another repo, with importing all necessary functions/types from the STG, and then calling generate_encounter, but potentially we could add this functionality into the STG.

Currently, generate_traffic_situations works based on paths to files, but when I have or generate data in other code, I don't wanna have to write that to files and then pass in paths.
Alternatively, one can use generate_encounter (which is what I did in the other code base), but then you have to yourself deal with passing in all the specific data types and do all necessary conversions, and write some similar code to as what as in the STG, to get a (or several) traffic situation(s) out of it in the end.

I reckon, ideally, we would make another generate_traffic_situation function, where base_situation, own_ship data, target ship data, and encounter settings, are passed in as func arguments - simplest would be if each can be passed in as dict[str, Any], without having to create the types that are inside the STG. With good documentation (docstrings and docs), it should be clear in which format things are to be passed in (e.g. maritime vs SI units), if we wanna avoid a bunch of checking on that and run the standard conversions.

Feel free to comment / suggest other approaches :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionSuggestion for improvements or new features

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions