diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..85101ea --- /dev/null +++ b/.coveragerc @@ -0,0 +1,13 @@ +[paths] +source = + src/trafficgen + */site-packages/trafficgen + +[run] +source = trafficgen +branch = True + +[report] +fail_under = 10.0 +show_missing = True +skip_covered = True diff --git a/.editorconfig b/.editorconfig index b46c31e..6dda6af 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,6 @@ root = true [*] indent_style = space indent_size = 4 -end_of_line = crlf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/.github/workflows/_build_and_publish_documentation.yml b/.github/workflows/_build_and_publish_documentation.yml index d4ba53f..2fed60c 100644 --- a/.github/workflows/_build_and_publish_documentation.yml +++ b/.github/workflows/_build_and_publish_documentation.yml @@ -15,19 +15,18 @@ jobs: - name: Checkout active branch uses: actions/checkout@v4 with: - fetch-depth: 1 lfs: true - - name: Install Python - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - python-version: '3.11' - cache: 'pip' # cache pip dependencies - - uses: actions/download-artifact@v4 + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Set up Python + uses: actions/setup-python@v5 with: - name: requirements-files - - name: Install dependencies - run: | - pip install -r requirements-docs.txt + python-version-file: "pyproject.toml" + - name: Install the project + run: uv sync --upgrade - name: Print debugging information run: | echo "github.ref:" ${{github.ref}} @@ -39,17 +38,15 @@ jobs: git branch git branch -a git remote -v - python -V - pip list --not-required - pip list + uv run python -V + uv pip list # Build documentation - uses: sphinx-doc/github-problem-matcher@master - name: Build documentation run: | cd docs - sphinx-apidoc -f -e -M -o . ../src/trafficgen - make html + uv run make html - name: Clone and cleanup gh-pages branch run: | diff --git a/.github/workflows/_build_package.yml b/.github/workflows/_build_package.yml index f6fe883..362d3aa 100644 --- a/.github/workflows/_build_package.yml +++ b/.github/workflows/_build_package.yml @@ -9,46 +9,21 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 lfs: true + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" - uses: actions/setup-python@v5 with: - python-version: '3.11' - cache: 'pip' # cache pip dependencies - - name: Install build and twine - run: pip install build twine - - name: Run build - run: python -m build + python-version-file: "pyproject.toml" + - name: Build source distribution and wheel + run: uv build - name: Run twine check - run: twine check --strict dist/* + run: uvx twine check --strict dist/* - uses: actions/upload-artifact@v4 with: - path: ./dist/*.tar.gz - - # build_wheels: - # name: Build wheels for ${{ matrix.platform }} - # needs: - # - black - # - ruff - # - pyright - # - test - # runs-on: ${{ matrix.platform }} - # strategy: - # matrix: - # platform: [ubuntu-latest, macos-latest, windows-latest] - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 1 - # lfs: true - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' - # cache: 'pip' # cache pip dependencies - # - name: Install cibuildwheel - # run: python -m pip install cibuildwheel==2.16 - # - name: Build wheels - # run: python -m cibuildwheel --output-dir wheels - # - uses: actions/upload-artifact@v4 - # with: - # path: ./wheels/*.whl + path: | + dist/*.tar.gz + dist/*.whl diff --git a/.github/workflows/_code_quality.yml b/.github/workflows/_code_quality.yml index 60f44f0..d3e65a7 100644 --- a/.github/workflows/_code_quality.yml +++ b/.github/workflows/_code_quality.yml @@ -3,55 +3,78 @@ name: Code Quality on: workflow_call jobs: - black: - name: black + ruff_format: runs-on: ubuntu-latest + name: ruff format steps: - uses: actions/checkout@v4 - - uses: psf/black@stable + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - options: '--check --diff' - src: '.' - jupyter: true - version: '==23.12' + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + - name: Install the project + run: uv sync --upgrade + - name: Run ruff format + run: uv run ruff format --diff - ruff: + ruff_check: runs-on: ubuntu-latest - name: ruff + name: ruff check steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' # cache pip dependencies - - uses: actions/download-artifact@v4 - with: - name: requirements-files - - name: Install dependencies - run: | - pip install -r requirements.txt - - name: Install ruff - run: pip install ruff==0.1.8 - - name: Run ruff - run: ruff . + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + - name: Install the project + run: uv sync --upgrade + - name: Run ruff check + run: uv run ruff check --diff pyright: runs-on: ubuntu-latest name: pyright steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' # cache pip dependencies - - uses: actions/download-artifact@v4 - with: - name: requirements-files - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install pytest - - name: Install pyright - run: pip install pyright==1.1.338 + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + - name: Install the project + run: uv sync --upgrade - name: Run pyright - run: pyright . + run: uv run pyright + + mypy: + runs-on: ubuntu-latest + name: mypy + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + - name: Install the project + run: uv sync --upgrade + - name: Run mypy + run: uv run mypy diff --git a/.github/workflows/_merge_into_release.yml b/.github/workflows/_merge_into_release.yml index cec3964..3396509 100644 --- a/.github/workflows/_merge_into_release.yml +++ b/.github/workflows/_merge_into_release.yml @@ -22,4 +22,10 @@ jobs: with: type: now target_branch: release - github_token: ${{ secrets.RELEASE_TOKEN }} + # @TODO: A dedicated RELEASE_TOKEN should be created in the repo settings + # and used for this task when in production. + # It is set here to the default GITHUB_TOKEN only + # for demonstration purposes, enabling the workflow in the repo template + # to run without additional configuration. + # github_token: ${{ secrets.RELEASE_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/_requirements_files.yml b/.github/workflows/_requirements_files.yml deleted file mode 100644 index 7e3b34d..0000000 --- a/.github/workflows/_requirements_files.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Requirements Files - -on: workflow_call - -jobs: - requirements: - name: Create requirements files from poetry - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' # cache pip dependencies - - name: Create requirements files from poetry.lock file - run: | - pip install poetry - pip install poetry-plugin-export - poetry lock - poetry export -o requirements.txt --without-hashes --format requirements.txt - poetry export -o requirements-dev.txt --without-hashes --format requirements.txt --with dev - poetry export -o requirements-docs.txt --without-hashes --format requirements.txt --with docs - - name: Upload requirements files as artifact - uses: actions/upload-artifact@v4 - with: - name: requirements-files - path: | - poetry.lock - requirements.txt - requirements-dev.txt - requirements-docs.txt - - name: Delete poetry.lock file - run: | - rm -f poetry.lock diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 504c4a7..5f635a0 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -4,32 +4,31 @@ on: workflow_call jobs: test: - name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} + name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}} runs-on: ${{ matrix.platform.runner }} strategy: matrix: platform: - runner: ubuntu-latest - toxenv: linux - runner: windows-latest - toxenv: windows + # - runner: macos-latest python: - - version: '3.9' - toxenv: 'py39' - - version: '3.10' - toxenv: 'py310' - version: '3.11' - toxenv: 'py311' - version: '3.12' - toxenv: 'py312' steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" - name: Install Python ${{ matrix.python.version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python.version }} - cache: 'pip' # cache pip dependencies - - name: Install tox - run: python -m pip install tox + - name: Install the project + run: uv sync -p ${{ matrix.python.version }} -U --no-dev - name: Run pytest - run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} + run: > + uv run --with pytest --with pytest-cov + pytest --cov diff --git a/.github/workflows/_test_future.yml b/.github/workflows/_test_future.yml index aed952a..71de688 100644 --- a/.github/workflows/_test_future.yml +++ b/.github/workflows/_test_future.yml @@ -1,31 +1,35 @@ -name: Unit Tests (py312) -# Test also with Python 3.12 (experimental; workflow will not fail on error.) +name: Unit Tests (py313) +# Test also with Python 3.13 (experimental; workflow will not fail on error.) on: workflow_call jobs: - test312: - name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} (experimental) + test313: + name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}} (experimental) continue-on-error: true runs-on: ${{ matrix.platform.runner }} strategy: matrix: platform: - runner: ubuntu-latest - toxenv: linux - runner: windows-latest - toxenv: windows python: - - version: '3.13.0a2' - toxenv: 'py313' + - version: '3.13.0-alpha - 3.13.0' + uvpy: '3.13' steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" - name: Install Python ${{ matrix.python.version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python.version }} - cache: 'pip' # cache pip dependencies - - name: Install tox - run: python -m pip install tox + - name: Install the project + run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev - name: Run pytest - run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} + run: > + uv run --with pytest --with pytest-cov + pytest --cov diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index d5b14c7..28f6868 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -6,20 +6,14 @@ on: - cron: '30 5 * * *' jobs: - requirements_files: - uses: ./.github/workflows/_requirements_files.yml code_quality: - needs: requirements_files uses: ./.github/workflows/_code_quality.yml test: - needs: requirements_files uses: ./.github/workflows/_test.yml test_future: - needs: requirements_files uses: ./.github/workflows/_test_future.yml build_package: needs: - - code_quality - test uses: ./.github/workflows/_build_package.yml build_and_publish_documentation: diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 2275117..faff098 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -7,28 +7,24 @@ on: - v* jobs: - # requirements_files: - # uses: ./.github/workflows/_requirements_files.yml - # build_package: - # needs: - # - requirements_files - # uses: ./.github/workflows/_build_package.yml - # publish_package: - # name: Publish package - # needs: - # - build_package - # runs-on: ubuntu-latest - # environment: release - # permissions: - # id-token: write - # steps: - # - uses: actions/download-artifact@v4 - # with: - # name: artifact - # path: dist - # - uses: pypa/gh-action-pypi-publish@release/v1 - # # with: # Uncomment this line to publish to testpypi - # # repository-url: https://test.pypi.org/legacy/ # Uncomment this line to publish to testpypi + build_package: + uses: ./.github/workflows/_build_package.yml + publish_package: + name: Publish package + needs: + - build_package + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + # with: # Uncomment this line to publish to testpypi + # repository-url: https://test.pypi.org/legacy/ # Uncomment this line to publish to testpypi merge_into_release: uses: ./.github/workflows/_merge_into_release.yml secrets: diff --git a/.github/workflows/pull_request_to_main.yml b/.github/workflows/pull_request_to_main.yml index 97d2742..2bff438 100644 --- a/.github/workflows/pull_request_to_main.yml +++ b/.github/workflows/pull_request_to_main.yml @@ -17,13 +17,9 @@ concurrency: cancel-in-progress: true jobs: - requirements_files: - uses: ./.github/workflows/_requirements_files.yml code_quality: - needs: requirements_files uses: ./.github/workflows/_code_quality.yml test: - needs: requirements_files uses: ./.github/workflows/_test.yml # build_package: # needs: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5cc0fbf..08debf2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -12,11 +12,7 @@ concurrency: cancel-in-progress: true jobs: - requirements_files: - uses: ./.github/workflows/_requirements_files.yml code_quality: - needs: requirements_files uses: ./.github/workflows/_code_quality.yml test: - needs: requirements_files uses: ./.github/workflows/_test.yml diff --git a/.github/workflows/push_to_main.yml b/.github/workflows/push_to_main.yml index 1e5257e..735f70b 100644 --- a/.github/workflows/push_to_main.yml +++ b/.github/workflows/push_to_main.yml @@ -11,13 +11,9 @@ concurrency: cancel-in-progress: true jobs: - requirements_files: - uses: ./.github/workflows/_requirements_files.yml code_quality: - needs: requirements_files uses: ./.github/workflows/_code_quality.yml test: - needs: requirements_files uses: ./.github/workflows/_test.yml build_package: needs: @@ -25,5 +21,6 @@ jobs: - test uses: ./.github/workflows/_build_package.yml build_and_publish_documentation: - needs: build_package + needs: + - build_package uses: ./.github/workflows/_build_and_publish_documentation.yml diff --git a/.github/workflows/push_to_release.yml b/.github/workflows/push_to_release.yml index 083caaf..8880838 100644 --- a/.github/workflows/push_to_release.yml +++ b/.github/workflows/push_to_release.yml @@ -11,8 +11,5 @@ concurrency: cancel-in-progress: true jobs: - requirements_files: - uses: ./.github/workflows/_requirements_files.yml build_and_publish_documentation: - needs: requirements_files uses: ./.github/workflows/_build_and_publish_documentation.yml diff --git a/.gitignore b/.gitignore index 688bef7..d5ac00e 100644 --- a/.gitignore +++ b/.gitignore @@ -111,4 +111,4 @@ ENV/ !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json -!.vscode/*.code-snippets \ No newline at end of file +!.vscode/*.code-snippets diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5e8d030 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: mixed-line-ending + args: [--fix=auto] + - id: trailing-whitespace + - id: check-yaml + - id: check-toml + - id: check-merge-conflict + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.8.3 + hooks: + - id: ruff-format + - id: ruff + # - repo: https://github.com/pre-commit/mirrors-mypy + # rev: v1.13.0 + # hooks: + # - id: mypy +exclude: '(.venv|.*_cache)/.*' diff --git a/.sourcery.yaml b/.sourcery.yaml index d611d79..032322b 100644 --- a/.sourcery.yaml +++ b/.sourcery.yaml @@ -9,27 +9,26 @@ # This file was auto-generated by Sourcery on 2023-02-22 at 11:42. -version: '1' # The schema version of this config file +version: '1' # The schema version of this config file ignore: # A list of paths or files which Sourcery will ignore. -- .git -- .venv -- .tox -- build -- dist -- __pycache__ - + - .git + - .venv + - .tox + - dist + - __pycache__ + - docs/build rule_settings: enable: - - default - disable: # A list of rule IDs Sourcery will never suggest. - - inline-immediately-returned-variable + - default + disable: # A list of rule IDs Sourcery will never suggest. + - inline-immediately-returned-variable rule_types: - - refactoring - - suggestion - - comment - python_version: '3.9' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version. + - refactoring + - suggestion + - comment + python_version: '3.10' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version. # rules: # A list of custom rules Sourcery will include in its analysis. # - id: no-print-statements diff --git a/AUTHORS.rst b/AUTHORS.rst deleted file mode 100644 index e4eec4e..0000000 --- a/AUTHORS.rst +++ /dev/null @@ -1,19 +0,0 @@ -======= -Authors -======= - -Primary author ---------------- -Tom Arne Pedersen -Tom.Arne.Pedersen@dnv.com - -Claas Rostock -claas.rostock@dnv.com - -Minos Hemrich -Minos.Hemrich@dnv.com - -Testers ---------------- -* Grunde Løvoll -* Stephanie Kemna diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cbd177f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,82 @@ +# Changelog + +All notable changes to the trafficgen project will be documented in this file.
+The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +## [Unreleased] + +-/- + +## [0.7.0] - 2025-01-22 + +### Changed + +* The python package Maritime Schema is no longer open source, necessary types have been included here to remove the link +* Project updated to use uv package installer +* Documentation has been updated +* Updating workflows +* Removed maxSpeed from the output files generated using the tool + + +## [0.6.0] - 2024-11-11 + +### Changed + +* Updated to download-artifact@v4 (from download-artifact@v3) + + +## [0.5.0] - 2024-04-26 + +### Changed + +* removed specific names for target ships. Files generated with target ship 1, 2 etc. +* changed tests. Still need to figure out why some tests "fail" using CLI. + + +## [0.4.0] - 2024-04-19 + +### Changed + +* possible to have several aypoints for own ship +* fixing pyright error +* beta (relative bearing between osn ship and target ship seen from own ship) + is not just a number, but could also be a range +* situation length is used when checking if target ship is passing land + + +## [0.3.0] - 2024-04-10 + +### Changed + +* using types from maritime schema +* lat/lon used instead of north/east +* the generated output files are using "maritime" units: knots and degrees + + +## [0.2.0] - 2024-01-11 + +### Changed + +* add-basic-code-quality-settings-black-ruff-pyright, +* first-small-round-of-code-improvement +* add-domain-specific-data-types-for-ship-situation-etc-using-pydantic-models, +* activate-remaining-pyright-rules, +* add-github-workflows-to-build-package-and-to-build-and-publish-documentation +* sorting output from os.listdir +* github workflow for release +* removed cyclic import +* length of encounter may be specified by user + + +## [0.1.0] - 2023-11-08 + +* First release on PyPI. + + + +[0.6.0]: https://github.com/dnv-opensource/ship-traffic-generator/releases/tag/v0.6.0 +[0.5.0]: https://github.com/dnv-opensource/ship-traffic-generator/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/dnv-opensource/ship-traffic-generator/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/dnv-opensource/ship-traffic-generator/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/dnv-opensource/ship-traffic-generator/releases/tag/v0.2.0 +[trafficgen]: https://github.com/dnv-opensource/ship-traffic-generator diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..fa9e5fb --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,39 @@ +cff-version: 1.2.0 +title: trafficgen +message: Ship Traffic Generator. +type: software +authors: + - name: DNV + address: 'Veritasveien 1, 1363 Høvik' + city: Oslo + website: 'https://www.dnv.com/' + - given-names: Tom Arne + family-names: Pedersen + email: Tom.Arne.Pedersen@dnv.com + affiliation: DNV + - given-names: Claas + family-names: Rostock + email: claas.rostock@dnv.com + affiliation: DNV + - given-names: Minos + family-names: Hemrich + email: Minos.Hemrich@dnv.com + affiliation: DNV +testers: + - given-names: Grunde + family-names: Løvoll + affiliation: DNV + - given-names: Stephanie + family-names: Kemna + affiliation: DNV +abstract: >- + The tool trafficgen generates unlimited set of encounters (based on input parameters) + to allow a systematic assessment of the vessel's ability to act according to COLREG + using simulation-based testing. +keywords: + - Traffic Generator + - Simulation-based testing + - Systematic assessment +license: MIT +url: 'https://github.com/dnv-opensource/ship-traffic-generator' +version: 0.7.0 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index fb60dd3..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. highlight:: shell - -============ -Contributing -============ - -Contributions are welcome, and they are greatly appreciated! Every little bit -helps, and credit will always be given. - -You can contribute in many ways: - -Types of Contributions ----------------------- - -Report Bugs -~~~~~~~~~~~ - -Report bugs at https://github.com/dnv-opensource/ship-traffic-generator/issues. - -If you are reporting a bug, please include: - -* Your operating system name and version. -* The version of Python (and Conda) that you are using. -* Any additional details about your local setup that might be helpful in troubleshooting. -* Detailed steps to reproduce the bug. - -Fix Bugs -~~~~~~~~ - -Look through the GitHub issues for bugs. Anything tagged with "bug" and "help -wanted" is open to whoever wants to implement it. - -Implement Features -~~~~~~~~~~~~~~~~~~ - -Look through the GitHub issues for features. Anything tagged with "enhancement" -and "help wanted" is open to whoever wants to implement it. - -Write Documentation -~~~~~~~~~~~~~~~~~~~ - -Traffic Generator could always use more documentation, whether as part of the -official Traffic Generator docs, in docstrings, or even on the web in blog posts, -articles, and such. - -Submit Feedback -~~~~~~~~~~~~~~~ - -The best way to send feedback is to file an issue at https://github.com/dnv-opensource/ship-traffic-generator/issues. - -If you are proposing a feature: - -* Explain in detail how it would work. -* Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions - are welcome :) - -Get Started! ------------- - -Ready to contribute? Here's how to set up `trafficgen` for local development. - -1. Clone the `trafficgen` repo on GitHub. -2. Install your local copy into a pyenv or conda environment. -3. Create a branch for local development:: - - $ git checkout -b name-of-your-bugfix-or-feature - - Now you can make your changes locally. - -4. When you're done making changes, check that your changes pass flake8 and the - tests, including testing other Python versions with tox:: - - $ flake8 --config tox.ini ./src/trafficgen ./tests - $ pytest ./tests - $ tox - - If you installed the package with `poetry` - - $ poetry install --with dev,docs - - flake8, pytest and tox should already be installed in your Python environment. - Note that the tox config assumes Python 3.10 and Python 3.11, you would have - to have them both available to tox for all tests to run. - If you only have one of these available tox will skip the non supported - environment (and in most cases that is OK). - If you are managing your Python enhancements with `pyenv` you will have to - install the necessary versions and then run `pyenv rehash` to make them - available to tox (or set multiple local envs with `pyenv local py310 py311`). - If you are using `conda` you will have to create a new environment with - the necessary Python version, install `virtualenv` in the environments - and then run `conda activate ` to make it available to tox (to run all - the environments in one go do `conda activate` inside activated environments). - - You can also run the python tests from VSCode via the "Testing" view, - "Configure Python Tests", with `pytest`` and select the folder `tests`. - -5. Commit your changes and push your branch to the source repo:: - - $ git add . - $ git commit -m "Your detailed description of your changes." - $ git push origin name-of-your-bugfix-or-feature - -6. Submit a pull request through https://github.com/dnv-opensource/ship-traffic-generator/pulls. - - -Pull Request Guidelines ------------------------ - -Before you submit a pull request, check that it meets these guidelines: - -1. The pull request should include tests. -2. If the pull request adds functionality, the docs should be updated. Put - your new functionality into a function with a docstring, and add the - feature to the list in README.md. -3. The pull request should work for Python 3.10. - - -Tips ----- - -To run a subset of tests:: - -$ pytest tests.test_trafficgen - - - -Deploying ---------- - -A reminder for the maintainers on how to deploy. -Make sure all your changes are committed (including an entry in HISTORY.rst). -Then run:: - -$ bump2version patch # possible: major / minor / patch -$ git push -$ git push --tags diff --git a/HISTORY.rst b/HISTORY.rst deleted file mode 100644 index d9a9e19..0000000 --- a/HISTORY.rst +++ /dev/null @@ -1,62 +0,0 @@ -======= -History -======= - - -0.6.0 (2024-11-11) ------------------- - -Changed - -* Updated to download-artifact@v4 (from download-artifact@v3) - -0.5.0 (2024-04-26) ------------------- - -Changed - -* removed specific names for target ships. Files generated with target ship 1, 2 etc. -* changed tests. Still need to figure out why some tests "fail" using CLI. - -0.4.0 (2024-04-19) ------------------- - -Changed - -* possible to have several aypoints for own ship -* fixing pyright error -* beta (relative bearing between osn ship and target ship seen from own ship) - is not just a number, but could also be a range -* situation length is used when checking if target ship is passing land - - -0.3.0 (2024-04-10) ------------------- - -Changed - -* using types from maritime schema -* lat/lon used instead of north/east -* the generated output files are using "maritime" units: knots and degrees - - -0.2.0 (2024-01-11) ------------------- - -Changed - -* add-basic-code-quality-settings-black-ruff-pyright, -* first-small-round-of-code-improvement -* add-domain-specific-data-types-for-ship-situation-etc-using-pydantic-models, -* activate-remaining-pyright-rules, -* add-github-workflows-to-build-package-and-to-build-and-publish-documentation -* sorting output from os.listdir -* github workflow for release -* removed cyclic import -* length of encounter may be specified by user - - -0.1.0 (2023-11-08) ------------------- - -* First release on PyPI. diff --git a/LICENSE b/LICENSE index 59ccfc7..5fb9fa4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 DNV open source +Copyright (c) 2025 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ae5094b..4e17035 100644 --- a/README.md +++ b/README.md @@ -5,88 +5,98 @@ the tool will generate a set of traffic situations. The traffic situations may b A paper is written describing the background for the tool and how it works [paper] +## Installation +To install Ship Traffic Generator, run this command in your terminal: +```sh +pip install trafficgen +``` +This is the preferred method to install Traffic Generator, as it will always install the most recent stable release. -## Quickstart -After you clone this repository, `trafficgen` can then be installed with the following steps: +You can check your installation by running: ```sh -$ cd ship_traffic_generator +uv run trafficgen --help ``` -It is recommended to install the `trafficgen` package and it's dependencies in a separate -Python environment (Anaconda, pyenv, or virtualenv). `trafficgen` requires Python 3.10 or higher. +See documentation for usage of the Ship Traffic Generator. -In Anaconda this can be done with: +## Development Setup + +### Install UV +This project uses `uv` as package manager. +If you haven't already, install [uv](https://docs.astral.sh/uv), preferably using it's ["Standalone installer"](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2) method:
+..on Windows: ```sh -$ conda create --name myenv python=3.10 -$ conda activate myenv +powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` - -In Powershell terminal with venv (also from VSCode), this can be done with: +..on MacOS and Linux: ```sh -$ python -m venv .venv -$ .venv\Scripts\Activate.ps1 +curl -LsSf https://astral.sh/uv/install.sh | sh ``` +(see [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/) for all / alternative installation methods.) -Then update pip/setuptools, and install the dependencies for this repo: +Once installed, you can update `uv` to its latest version, anytime, by running: ```sh -$ python -m pip install --upgrade pip setuptools -$ pip install -e . +uv self update ``` -This will install the `trafficgen` Python package and command line tool (cli). -You can check your installation by running: +### Install Python +The traffic generator requires Python 3.11 or later.
+ +If you don't already have a compatible version installed on your machine, you way install Python through `uv`: ```sh -$ trafficgen --help +uv python install ``` +This will install the latest stable version of Python into the uv Python directory, i.e. as a uv-managed version of Python. -For more information on usage, run: +Alternatively, and if you want a standalone version of Python on your machine, you can install Python either via `winget`: ```sh -$ trafficgen gen-situation --help +winget install --id Python.Python ``` -or build the documentation (see below). +or you can download and install Python from the [python.org](https://www.python.org/downloads/) website. -## Development & Documentation -For development (dependency management, documentation and testing) it is recommended to use [Poetry](https://python-poetry.org/docs/). -See Poetry's documentation for information of how to install and set up. +### Clone the repository +Clone the traffig generator repository into your local development directory: +```sh +git clone https://github.com/dnv-opensource/ship-traffic-generator path/to/your/dir/ship-traffic-generator +``` +Change into the project directory after cloning: +```sh +cd ship-traffic-generator +``` -See above notes about creating and using a virtual environment. -To install the package, including dev and doc dependencies: +### Install dependencies +Run `uv sync` to create a virtual environment and install all project dependencies into it: ```sh -$ cd ship_traffic_generator -$ poetry install -$ poetry install --with dev,docs +uv sync ``` -which will install the package, the cli and all development and documentation dependencies. +> **Note**: Using `--no-dev` will omit installing development dependencies. +> **Note**: `uv` will create a new virtual environment called `.venv` in the project root directory when running +> `uv sync` the first time. Optionally, you can create your own virtual environment using e.g. `uv venv`, before running +> `uv sync`. -You can check your installation with: +### (Optional) Activate the virtual environment +When using `uv`, there is in almost all cases no longer a need to manually activate the virtual environment.
+`uv` will find the `.venv` virtual environment in the working directory or any parent directory, and activate it on the fly whenever you run a command via `uv` inside your project folder structure: ```sh -$ trafficgen --help +uv run ``` -or + +However, you still _can_ manually activate the virtual environment if needed. +When developing in an IDE, for instance, this can in some cases be necessary depending on your IDE settings. +To manually activate the virtual environment, run one of the "known" legacy commands:
+..on Windows: ```sh -$ trafficgen gen-situation --help +.venv\Scripts\activate.bat ``` -Note: You may have to restart your terminal (or update the path) for the command line command to work, or use the Poetry shell (`poetry shell`) to correct the search path. - -Testing in the project is done using [pytest](https://docs.pytest.org/) and -the format of the code is checked with [flake8](https://flake8.pycqa.org/en/latest/). -You can run the tests and check formating with [`tox`](https://tox.wiki/): +..on Linux: ```sh -$ tox run +source .venv/bin/activate ``` -To generate documentation do: +### Documentation +To generate documentation use: ```sh -$ cd docs -$ sphinx-build -M html . build +uv run docs/make.bat html ``` The html documentation will then be available in `docs/build/html/index.html` - - - - -## Credits -This package was created with Cookiecutter and the `audreyr/cookiecutter-pypackage` project template. -* [Cookiecutter](https://github.com/audreyr/cookiecutter) -* [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md new file mode 100644 index 0000000..d4ab3f8 --- /dev/null +++ b/STYLEGUIDE.md @@ -0,0 +1,423 @@ + +# Style Guide + +All code shall be [Ruff](https://docs.astral.sh/ruff) formatted. + +References, details as well as examples of bad/good styles and their respective reasoning can be found below. + +## References + +* [PEP-8](https://www.python.org/dev/peps/pep-0008/) (see also [pep8.org](https://pep8.org/)) +* [PEP-257](https://www.python.org/dev/peps/pep-0257/) +* Python style guide by [theluminousmen.com](https://luminousmen.com/post/the-ultimate-python-style-guidelines) +* [Documenting Python Code: A Complete Guide](https://realpython.com/documenting-python-code) +* [Jupyter](https://jupyter.readthedocs.io/en/latest/contributing/ipython-dev-guide/coding_style.html) style guide +* Python style guide on [learnpython.com](https://learnpython.com/blog/python-coding-best-practices-and-style-guidelines/) +* [Ruff](https://docs.astral.sh/ruff) + +## Code Layout + +* Use 4 spaces instead of tabs +* Maximum line length is 120 characters (not 79 as proposed in [PEP-8](https://www.python.org/dev/peps/pep-0008/)) +* 2 blank lines between classes and functions +* 1 blank line within class, between class methods +* Use blank lines for logic separation of functionality within functions/methods wherever it is justified +* No whitespace adjacent to parentheses, brackets, or braces + +```py + # Bad + spam( items[ 1 ], { key1 : arg1, key2 : arg2 }, ) + + # Good + spam(items[1], {key1: arg1, key2: arg2}, []) +``` + +* Surround operators with single whitespace on either side. + +```py + # Bad + x<1 + + # Good + x == 1 +``` + +* Never end your lines with a semicolon, and do not use a semicolon to put two statements on the same line +* When branching, always start a new block on a new line + +```py + # Bad + if flag: return None + + # Good + if flag: + return None +``` + +* Similarly to branching, do not write methods on one line in any case: + +```py + # Bad + def do_something(self): print("Something") + + # Good + def do_something(self): + print("Something") +``` + +* Place a class's `__init__` function (the constructor) always at the beginning of the class + +## Line Breaks + +* If function arguments do not fit into the specified line length, move them to a new line with indentation + +```py + # Bad + def long_function_name(var_one, var_two, var_three, + var_four): + print(var_one) + + # Bad + def long_function_name(var_one, var_two, var_three, + var_four): + print(var_one) + + # Better (but not preferred) + def long_function_name(var_one, + var_two, + var_three, + var_four): + print(var_one) + + # Good (and preferred) + def long_function_name( + var_one, + var_two, + var_three, + var_four, + ): + print(var_one) +``` + +* Move concatenated logical conditions to new lines if the line does not fit the maximum line size. This will help you understand the condition by looking from top to bottom. Poor formatting makes it difficult to read and understand complex predicates. + +```py + # Good + if ( + this_is_one_thing + and that_is_another_thing + or that_is_third_thing + or that_is_yet_another_thing + and one_more_thing + ): + do_something() +``` + +* Where binary operations stretch multiple lines, break lines before the binary operators, not thereafter + +```py + # Bad + GDP = ( + private_consumption + + gross_investment + + government_investment + + government_spending + + (exports - imports) + ) + + # Good + GDP = ( + private_consumption + + gross_investment + + government_investment + + government_spending + + (exports - imports) + ) +``` + +* Chaining methods should be broken up on multiple lines for better readability + +```py + ( + df.write.format("jdbc") + .option("url", "jdbc:postgresql:dbserver") + .option("dbtable", "schema.tablename") + .option("user", "username") + .option("password", "password") + .save() + ) +``` + +* Add a trailing comma to sequences of items when the closing container token ], ), or } does not appear on the same line as the final element + +```py + # Bad + y = [ + 0, + 1, + 4, + 6 + ] + z = { + 'a': 1, + 'b': 2 + } + + # Good + x = [1, 2, 3] + + # Good + y = [ + 0, + 1, + 4, + 6, <- note the trailing comma + ] + z = { + 'a': 1, + 'b': 2, <- note the trailing comma + } +``` + +## String Formatting + +* When quoting string literals, use double-quoted strings. When the string itself contains single or double quote characters, however, use the respective other one to avoid backslashes in the string. It improves readability. +* Use f-strings to format strings: + +```py + # Bad + print("Hello, %s. You are %s years old. You are a %s." % (name, age, profession)) + + # Good + print(f"Hello, {name}. You are {age} years old. You are a {profession}.") +``` + +* Use multiline strings, not \ , since it gets much more readable. + +```py + raise AttributeError( + "Here is a multiline error message with a very long first line " + "and a shorter second line." + ) +``` + +## Naming Conventions + +* For module names: `lowercase` . +Long module names can have words separated by underscores (`really_long_module_name.py`), but this is not required. Try to use the convention of nearby files. +* For class names: `CamelCase` +* For methods, functions, variables and attributes: `lowercase_with_underscores` +* For constants: `UPPERCASE` or `UPPERCASE_WITH_UNDERSCORES` +(Python does not differentiate between variables and constants. Using UPPERCASE for constants is just a convention, but helps a lot to quickly identify variables meant to serve as constants.) +* Implementation-specific private methods and variables will use `_single_underscore_prefix` +* Don't include the type of a variable in its name. + E.g. use `senders` instead of `sender_list` +* Names shall be clear about what a variable, class, or function contains or does. If you struggle to come up with a clear name, rethink your architecture: Often, the difficulty in finding a crisp name for something is a hint that separation of responsibilities can be improved. The solution then is less to agree on a name, but to start a round of refactoring: The name you're seeking often comes naturally then with refactoring to an improved architecture with clear responsibilities. +(see [SRP](https://en.wikipedia.org/wiki/Single-responsibility_principle), Single-Responsibilty Principle by Robert C. Martin) + +## Named Arguments + +* Use named arguments to improve readability and avoid mistakes introduced with future code maintenance + +```py + # Bad + urlget("[http://google.com](http://google.com/)", 20) + + # Good + urlget("[http://google.com](http://google.com/)", timeout=20) +``` + +* Never use mutable objects as default arguments in Python. If an attribute in a class or a named parameter in a function is of a mutable data type (e.g. a list or dict), never set its default value in the declaration of an object but always set it to None first, and then only later assign the default value in the class's constructor, or the functions body, respectively. Sounds complicated? If you prefer the shortcut, the examples below are your friend. +If you are interested in the long story including the why‘s, read these discussions on [Reddit](https://old.reddit.com/r/Python/comments/opb7hm/do_not_use_mutable_objects_as_default_arguments/) and [Twitter](https://twitter.com/willmcgugan/status/1419616480971399171). + +```py + # Bad + class Foo: + items = [] + + # Good + class Foo: + items = None + def __init__(self): + self.items = [] + + + # Bad + class Foo: + def __init__(self, items=[]): + self.items = items + + # Good + class Foo: + def __init__(self, items=None): + self.items = items or [] + + + # Bad + def some_function(x, y, items=[]): + ... + + # Good + def some_function(x, y, items=None): + items = items or [] + ... +``` + +## Commenting + +* First of all, if the code needs comments to clarify its work, you should think about refactoring it. The best comment to code is the code itself. +* Describe complex, possibly incomprehensible points and side effects in the comments +* Separate `#` and the comment with one whitespace + +```py + #bad comment + # good comment +``` + +* Use inline comments sparsely +* Where used, inline comments shall have 2 whitespaces before the `#` and one whitespace thereafter + +```py + x = y + z # inline comment + str1 = str2 + str3 # another inline comment +``` + +* If a piece of code is poorly understood, mark the piece with a `@TODO:` tag and your name to support future refactoring: + +```py + def get_ancestors_ids(self): + # @TODO: Do a cache reset while saving the category tree. CLAROS, YYYY-MM-DD + cache_name = f"{self._meta.model_name}_ancestors_{self.pk}" + cached_ids = cache.get(cache_name) + if cached_ids: + return cached_ids + + ids = [c.pk for c in self.get_ancestors(include_self=True)] + cache.set(cache_name, ids, timeout=3600) + + return ids +``` + +## Type hints + +* Use type hints in function signatures and module-scope variables. This is good documentation and can be used with linters for type checking and error checking. Use them whenever possible. +* Use pyi files to type annotate third-party or extension modules. + +## Docstrings + +* All Docstrings should be written in [Numpy](https://numpydoc.readthedocs.io/en/latest/format.html) format. For a good tutorial on Docstrings, see [Documenting Python Code: A Complete Guide](https://realpython.com/documenting-python-code) +* In a Docstring, summarize function/method behavior and document its arguments, return value(s), side effects, exceptions raised, and restrictions +* Wrap Docstrings with triple double quotes (""") +* The description of the arguments must be indented + +```py + def some_method(name, print=False): + """This function does something + + Parameters + ---------- + name : str + The name to use + print: bool, optional + A flag used to print the name to the console, by default False + + Raises + ------ + KeyError + If name is not found + + Returns + ------- + int + The return code + """ + ... + return 0 +``` + +## Exceptions + +* Raise specific exceptions and catch specific exceptions, such as KeyError, ValueError, etc. +* Do not raise or catch just Exception, except in rare cases where this is unavoidable, such as a try/except block on the top-level loop of some long-running process. For a good tutorial on why this matters, see [The Most Diabolical Python Antipattern](https://realpython.com/the-most-diabolical-python-antipattern/). +* Minimize the amount of code in a try/except block. The larger the body of the try, + the more likely that an exception will be raised by a line of code that you didn’t expect to raise an exception. + +## Imports + +* Avoid creating circular imports by importing modules more specialized than the one you are editing +* Relative imports are forbidden ([PEP-8](https://www.python.org/dev/peps/pep-0008/) only “highly discourages” them). Where absolutely needed, the `from future import absolute_import` syntax should be used (see [PEP-328](https://www.python.org/dev/peps/pep-0328/)) +* Never use wildcard imports (`from import *`). Always be explicit about what you're importing. Namespaces make code easier to read, so use them. +* Break long imports using parentheses and indent by 4 spaces. Include the trailing comma after the last import and place the closing bracket on a separate line + +```py + from my_pkg.utils import ( + some_utility_method_1, + some_utility_method_2, + some_utility_method_3, + some_utility_method_4, + some_utility_method_5, + ) +``` + +* Imports should be written in the following order, separated by a blank line: + 1. build-in modules + 2. third-party modules + 3. local application/library specific imports + +```py + import logging + import os + import typing as T + + import pandas as pd + import numpy as np + + import my_package + import my_package.my_module + from my_package.my_module import my_function, MyClass +``` + +* Even if a Python file is intended to be used as executable / script file only, it shall still be importable as a module, and its import should not have any side effects. Its main functionality shall hence be in a `main()` function, so that the code can be imported as a module for testing or being reused in the future: + +```py + def main(): + ... + + if __name__ == "__main__": + main() +``` + +## Unit-tests + +* Use pytest as the preferred testing framework. +* The name of a test shall clearly express what is being tested. +* Each test should preferably check only one specific aspect. + +```py + # Bad + def test_smth(): + result = f() + assert isinstance(result, list) + assert result[0] == 1 + assert result[1] == 2 + assert result[2] == 3 + assert result[3] == 4 + + # Good + def test_smth_type(): + result = f() + assert isinstance(result, list), "Result should be list" + + def test_smth_values(): + result = f() + assert set(result) == set(expected), f"Result should be {set(expected)}" +``` + +## And finally: It is a bad idea to use + +* global variables. +* iterators where they can be replaced by vectorized operations. +* lambda where it is not required. +* map and lambda where it can be replaced by a simple list comprehension. +* multiple nested maps and lambdas. +* nested functions. They are hard to test and debug. diff --git a/condaenv.yml b/condaenv.yml deleted file mode 100644 index 5cf20f8..0000000 --- a/condaenv.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: testenv -channels: -- defaults -dependencies: -- pip \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_01.json b/data/baseline_situations_generated/traffic_situation_01.json index 260018f..b814c7e 100644 --- a/data/baseline_situations_generated/traffic_situation_01.json +++ b/data/baseline_situations_generated/traffic_situation_01.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO", "description": "A head on situation with one target ship.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,73 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "831e1ab2-8600-42cf-a91b-512230d49af7", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.84117519, - "longitude": 10.49587268 + "lon": 10.49680582, + "lat": 58.85500037 }, "sog": 12.1, - "cog": 183.12, - "heading": 183.12, + "cog": 183.63, + "heading": 183.63, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84117519, - "longitude": 10.49587268 + "lon": 10.49680582, + "lat": 58.85500037 } }, { "position": { - "latitude": 58.80782874, - "longitude": 10.49237693 + "lon": 10.48458595, + "lat": 58.75501409 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_02.json b/data/baseline_situations_generated/traffic_situation_02.json index 8faf4dd..2041cc0 100644 --- a/data/baseline_situations_generated/traffic_situation_02.json +++ b/data/baseline_situations_generated/traffic_situation_02.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW", "description": "A crossing situation with one target ship. Own ship is give-way.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,73 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "0482dfbe-fe16-46db-8dfc-eab8cd6bca1f", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.81117278, - "longitude": 10.52409158 + "lon": 10.52697741, + "lat": 58.81530237 }, "sog": 8.0, - "cog": 220.93, - "heading": 220.93, + "cog": 225.4, + "heading": 225.4, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81117278, - "longitude": 10.52409158 + "lon": 10.52697741, + "lat": 58.81530237 } }, { "position": { - "latitude": 58.79448844, - "longitude": 10.49624045 + "lon": 10.43617067, + "lat": 58.76878387 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_03.json b/data/baseline_situations_generated/traffic_situation_03.json index 42d3667..ea479b9 100644 --- a/data/baseline_situations_generated/traffic_situation_03.json +++ b/data/baseline_situations_generated/traffic_situation_03.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO", "description": "A crossing situation with one target ship. Own ship is stand-on.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,73 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "8a650f7e-fb26-426d-8549-dd11fc370fb1", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.80568759, - "longitude": 10.44372042 + "lon": 10.43613433, + "lat": 58.81250143 }, "sog": 6.0, - "cog": 120.78, - "heading": 120.78, + "cog": 93.97, + "heading": 93.97, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80568759, - "longitude": 10.44372042 + "lon": 10.43613433, + "lat": 58.81250143 } }, { "position": { - "latitude": 58.79714267, - "longitude": 10.47133461 + "lon": 10.53232818, + "lat": 58.80903752 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_04.json b/data/baseline_situations_generated/traffic_situation_04.json index 2959c80..48c522f 100644 --- a/data/baseline_situations_generated/traffic_situation_04.json +++ b/data/baseline_situations_generated/traffic_situation_04.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW", "description": "A overting situation with one target ship. Own ship is give-way.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,73 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "c100dcad-206c-4ec2-83c6-86de7ca39221", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.77167228, - "longitude": 10.49490498 + "lon": 10.50093584, + "lat": 58.78336982 }, "sog": 5.1, - "cog": 353.51, - "heading": 353.51, + "cog": 344.18, + "heading": 344.18, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.77167228, - "longitude": 10.49490498 + "lon": 10.50093584, + "lat": 58.78336982 } }, { "position": { - "latitude": 58.78558739, - "longitude": 10.4918603 + "lon": 10.47888298, + "lat": 58.82379175 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_05.json b/data/baseline_situations_generated/traffic_situation_05.json index f576339..92b9fc5 100644 --- a/data/baseline_situations_generated/traffic_situation_05.json +++ b/data/baseline_situations_generated/traffic_situation_05.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-SO", "description": "A overtaking situation with one target ship. Own ship is stand-on.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,73 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "42f738ce-1f6d-4bcb-96ec-8fbc0795741a", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.70853434, - "longitude": 10.46233142 + "lon": 10.47731353, + "lat": 58.73759413 }, - "sog": 15.9, - "cog": 10.08, - "heading": 10.08, + "sog": 15.0, + "cog": 5.04, + "heading": 5.04, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70853434, - "longitude": 10.46233142 + "lon": 10.47731353, + "lat": 58.73759413 } }, { "position": { - "latitude": 58.75202075, - "longitude": 10.47721773 + "lon": 10.4983629, + "lat": 58.86153921 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_06.json b/data/baseline_situations_generated/traffic_situation_06.json index b8762a5..46f35a3 100644 --- a/data/baseline_situations_generated/traffic_situation_06.json +++ b/data/baseline_situations_generated/traffic_situation_06.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO", "description": "Head-on situations with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "d97b0f47-c470-44be-916b-f2e46429bff3", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.81839957, - "longitude": 10.488805 + "lon": 10.48871859, + "lat": 58.8211646 }, "sog": 8.9, - "cog": 177.96, - "heading": 177.96, + "cog": 177.9, + "heading": 177.9, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81839957, - "longitude": 10.488805 + "lon": 10.48871859, + "lat": 58.8211646 } }, { "position": { - "latitude": 58.79363768, - "longitude": 10.49050219 + "lon": 10.49395317, + "lat": 58.74688162 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "0c8db8b3-7e6b-4a4c-93f3-f01994278ae1", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.83385863, - "longitude": 10.50012366 + "lon": 10.50160978, + "lat": 58.84484694 }, "sog": 11.1, - "cog": 186.56, - "heading": 186.56, + "cog": 187.59, + "heading": 187.59, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83385863, - "longitude": 10.50012366 + "lon": 10.50160978, + "lat": 58.84484694 } }, { "position": { - "latitude": 58.80335669, - "longitude": 10.49337704 + "lon": 10.47820289, + "lat": 58.75354521 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_07.json b/data/baseline_situations_generated/traffic_situation_07.json index 21e431e..53b8936 100644 --- a/data/baseline_situations_generated/traffic_situation_07.json +++ b/data/baseline_situations_generated/traffic_situation_07.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-GW", "description": "A head-on and crossing give-way situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,68 +16,79 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "3fab281a-7da8-4412-844c-5bc4a21c063f", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.86837667, - "longitude": 10.47653591 + "lon": 10.4728379, + "lat": 58.8958744 }, "sog": 14.0, - "cog": 174.58, - "heading": 174.58, + "cog": 173.15, + "heading": 173.15, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86837667, - "longitude": 10.47653591 + "lon": 10.4728379, + "lat": 58.8958744 } }, { "position": { - "latitude": 58.82976775, - "longitude": 10.48358685 + "lon": 10.49955736, + "lat": 58.78035852 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "35f3c17a-93ae-41a7-8806-96b6a6f1d3f6", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.79364892, - "longitude": 10.53288731 + "lon": 10.53288731, + "lat": 58.79364892 }, "sog": 8.0, "cog": 263.5, @@ -96,17 +98,31 @@ "waypoints": [ { "position": { - "latitude": 58.79364892, - "longitude": 10.53288731 + "lon": 10.53288731, + "lat": 58.79364892 } }, { "position": { - "latitude": 58.79115016, - "longitude": 10.4906505 + "lon": 10.40617688, + "lat": 58.78615264 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_08.json b/data/baseline_situations_generated/traffic_situation_08.json index 5065cf4..7d4faf8 100644 --- a/data/baseline_situations_generated/traffic_situation_08.json +++ b/data/baseline_situations_generated/traffic_situation_08.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-SO", "description": "A head-on and crossing stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "960f3b94-44a3-4626-bc20-3c0f613e2d75", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.86111396, - "longitude": 10.50380439 + "lon": 10.50456473, + "lat": 58.86680563 }, - "sog": 16.9, - "cog": 185.58, - "heading": 185.58, + "sog": 15.0, + "cog": 186.67, + "heading": 186.67, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86111396, - "longitude": 10.50380439 + "lon": 10.50456473, + "lat": 58.86680563 } }, { "position": { - "latitude": 58.81447416, - "longitude": 10.49503177 + "lon": 10.47674734, + "lat": 58.74322116 } } - ] - }, - { + ], "static": { - "id": "238c3a83-f3bb-4540-a720-5c4f5d500736", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.80071412, - "longitude": 10.4385363 + "lon": 10.43573688, + "lat": 58.80271608 }, "sog": 8.0, - "cog": 109.43, - "heading": 109.43, + "cog": 96.49, + "heading": 96.49, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80071412, - "longitude": 10.4385363 + "lon": 10.43573688, + "lat": 58.80271608 } }, { "position": { - "latitude": 58.79336585, - "longitude": 10.47862388 + "lon": 10.56244998, + "lat": 58.79523199 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_09.json b/data/baseline_situations_generated/traffic_situation_09.json index 96903e7..0a7c761 100644 --- a/data/baseline_situations_generated/traffic_situation_09.json +++ b/data/baseline_situations_generated/traffic_situation_09.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, OT-GW", "description": "A head-on and overtaking give-way situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "86c0c0b8-886d-4f0d-90ea-ab8f8367375a", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.83100382, - "longitude": 10.48610925 + "lon": 10.48555628, + "lat": 58.83929892 }, "sog": 11.1, - "cog": 176.59, - "heading": 176.59, + "cog": 176.18, + "heading": 176.18, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83100382, - "longitude": 10.48610925 + "lon": 10.48555628, + "lat": 58.83929892 } }, { "position": { - "latitude": 58.80035566, - "longitude": 10.48962903 + "lon": 10.49735423, + "lat": 58.74739511 } } - ] - }, - { + ], "static": { - "id": "15b167ea-e6b0-4327-b510-12b57861f131", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.76877259, - "longitude": 10.49245116 + "lon": 10.49820554, + "lat": 58.78572189 }, "sog": 5.1, - "cog": 357.58, - "heading": 357.58, + "cog": 349.91, + "heading": 349.91, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76877259, - "longitude": 10.49245116 + "lon": 10.49820554, + "lat": 58.78572189 } }, { "position": { - "latitude": 58.78276485, - "longitude": 10.49131429 + "lon": 10.48403063, + "lat": 58.82708565 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_10.json b/data/baseline_situations_generated/traffic_situation_10.json index 4e128eb..2c46bbe 100644 --- a/data/baseline_situations_generated/traffic_situation_10.json +++ b/data/baseline_situations_generated/traffic_situation_10.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, OT-SO", "description": "A head-on and overtaking stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,33 +16,39 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "74b2d8bc-bd2f-43e6-b9c3-b78480b593ba", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.83785356, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85725369 }, "sog": 9.9, "cog": 180.02, @@ -61,52 +58,71 @@ "waypoints": [ { "position": { - "latitude": 58.83785356, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85725369 } }, { "position": { - "latitude": 58.81038277, - "longitude": 10.49063246 + "lon": 10.49058938, + "lat": 58.77484131 } } - ] - }, - { + ], "static": { - "id": "618785ce-4350-4752-aeaa-416caa2f26ff", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.71205347, - "longitude": 10.49756616 + "lon": 10.49452481, + "lat": 58.7347483 }, - "sog": 19.1, - "cog": 357.41, - "heading": 357.41, + "sog": 16.9, + "cog": 358.39, + "heading": 358.39, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71205347, - "longitude": 10.49756616 + "lon": 10.49452481, + "lat": 58.7347483 } }, { "position": { - "latitude": 58.76478662, - "longitude": 10.4929765 + "lon": 10.48689856, + "lat": 58.8752783 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_11.json b/data/baseline_situations_generated/traffic_situation_11.json index 7e35f42..c9c3bd1 100644 --- a/data/baseline_situations_generated/traffic_situation_11.json +++ b/data/baseline_situations_generated/traffic_situation_11.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-GW", "description": "Two crossing give-way situations with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "584396d0-b857-464a-be74-3de88c809064", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.85321387, - "longitude": 10.54679803 + "lon": 10.5600521, + "lat": 58.87441845 }, "sog": 13.0, - "cog": 205.18, - "heading": 205.18, + "cog": 211.71, + "heading": 211.71, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.85321387, - "longitude": 10.54679803 + "lon": 10.5600521, + "lat": 58.87441845 } }, { "position": { - "latitude": 58.8205531, - "longitude": 10.51724645 + "lon": 10.45051847, + "lat": 58.78231131 } } - ] - }, - { + ], "static": { - "id": "f44400d1-df41-42d7-9015-de6fed6212a3", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.75394195, - "longitude": 10.57672769 + "lon": 10.55272521, + "lat": 58.75659028 }, "sog": 14.0, - "cog": 309.74, - "heading": 309.74, + "cog": 326.36, + "heading": 326.36, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75394195, - "longitude": 10.57672769 + "lon": 10.55272521, + "lat": 58.75659028 } }, { "position": { - "latitude": 58.77873617, - "longitude": 10.5193251 + "lon": 10.4286502, + "lat": 58.85344947 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_12.json b/data/baseline_situations_generated/traffic_situation_12.json index a023b62..2b7047f 100644 --- a/data/baseline_situations_generated/traffic_situation_12.json +++ b/data/baseline_situations_generated/traffic_situation_12.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-SO", "description": "A crossing give-way and crossing stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "a6668e31-c0a0-4f1b-9105-b553ebfd179f", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.81997959, - "longitude": 10.5994687 + "lon": 10.61125394, + "lat": 58.82610217 }, "sog": 12.1, - "cog": 242.99, - "heading": 242.99, + "cog": 260.92, + "heading": 260.92, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81997959, - "longitude": 10.5994687 + "lon": 10.61125394, + "lat": 58.82610217 } }, { "position": { - "latitude": 58.80481372, - "longitude": 10.54219642 + "lon": 10.42081859, + "lat": 58.81029982 } } - ] - }, - { + ], "static": { - "id": "8025dec0-96fa-4dfe-9a9f-6faef3c89b39", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.75617732, - "longitude": 10.40223017 + "lon": 10.4322808, + "lat": 58.7586461 }, "sog": 13.0, - "cog": 52.71, - "heading": 52.71, + "cog": 31.68, + "heading": 31.68, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75617732, - "longitude": 10.40223017 + "lon": 10.4322808, + "lat": 58.7586461 } }, { "position": { - "latitude": 58.77804081, - "longitude": 10.45749841 + "lon": 10.5417422, + "lat": 58.8507764 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_13.json b/data/baseline_situations_generated/traffic_situation_13.json index 1d211c7..63c00e5 100644 --- a/data/baseline_situations_generated/traffic_situation_13.json +++ b/data/baseline_situations_generated/traffic_situation_13.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, OT-GW", "description": "A crossing give-way and overtaking give-way situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { + "initial": { + "position": { + "lon": 10.63373574, + "lat": 58.8063609 + }, + "sog": 15.0, + "cog": 275.36, + "heading": 275.36, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.63373574, + "lat": 58.8063609 + } + }, + { + "position": { + "lon": 10.39527798, + "lat": 58.81799159 + } + } + ], "static": { - "id": "54f7a3b1-781a-4ef9-b1e6-14ee3ea54e37", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, + "id": 10, "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.8057235, - "longitude": 10.63159297 + "lon": 10.50983525, + "lat": 58.77768713 }, - "sog": 15.0, - "cog": 258.75, - "heading": 258.75, + "sog": 7.0, + "cog": 339.94, + "heading": 339.94, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8057235, - "longitude": 10.63159297 + "lon": 10.50983525, + "lat": 58.77768713 } }, { "position": { - "latitude": 58.79763043, - "longitude": 10.55329214 + "lon": 10.47141908, + "lat": 58.83232999 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_14.json b/data/baseline_situations_generated/traffic_situation_14.json index 4edaafb..d65bedd 100644 --- a/data/baseline_situations_generated/traffic_situation_14.json +++ b/data/baseline_situations_generated/traffic_situation_14.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, OT-SO", "description": "A crossing give-way and overtaking stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "0730c9b8-bf79-4697-98b9-b8701156e32c", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.76938305, - "longitude": 10.55540367 + "lon": 10.54539832, + "lat": 58.76846736 }, "sog": 12.1, - "cog": 302.92, - "heading": 302.92, + "cog": 314.78, + "heading": 314.78, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76938305, - "longitude": 10.55540367 + "lon": 10.54539832, + "lat": 58.76846736 } }, { "position": { - "latitude": 58.78753398, - "longitude": 10.50144419 + "lon": 10.40851781, + "lat": 58.83904189 } } - ] - }, - { + ], "static": { - "id": "0ce05829-8d8c-485d-b269-548613d4acb9", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.72454999, - "longitude": 10.44741843 + "lon": 10.4606725, + "lat": 58.73646298 }, "sog": 16.9, - "cog": 18.62, - "heading": 18.62, + "cog": 12.78, + "heading": 12.78, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72454999, - "longitude": 10.44741843 + "lon": 10.4606725, + "lat": 58.73646298 } }, { "position": { - "latitude": 58.76895875, - "longitude": 10.47622127 + "lon": 10.52051986, + "lat": 58.87356769 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_15.json b/data/baseline_situations_generated/traffic_situation_15.json index aefbb08..fbc7518 100644 --- a/data/baseline_situations_generated/traffic_situation_15.json +++ b/data/baseline_situations_generated/traffic_situation_15.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, CR-SO", "description": "Two crossing stand-on situations with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "2115262c-7370-4b46-8451-d7ce8a8ad67c", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.76931123, - "longitude": 10.36160394 + "lon": 10.38187386, + "lat": 58.76839554 }, "sog": 15.0, - "cog": 71.96, - "heading": 71.96, + "cog": 53.29, + "heading": 53.29, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76931123, - "longitude": 10.36160394 + "lon": 10.38187386, + "lat": 58.76839554 } }, { "position": { - "latitude": 58.782153, - "longitude": 10.43751625 + "lon": 10.57386696, + "lat": 58.84278196 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "7168451e-d929-4f7e-a004-4655c112c734", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.75379831, - "longitude": 10.38532994 + "lon": 10.4155188, + "lat": 58.75656335 }, - "sog": 15.9, - "cog": 55.69, - "heading": 55.69, + "sog": 15.0, + "cog": 38.85, + "heading": 38.85, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75379831, - "longitude": 10.38532994 + "lon": 10.4155188, + "lat": 58.75656335 } }, { "position": { - "latitude": 58.77869396, - "longitude": 10.45555736 + "lon": 10.56574599, + "lat": 58.85347032 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_16.json b/data/baseline_situations_generated/traffic_situation_16.json index 8c80897..6cc20d6 100644 --- a/data/baseline_situations_generated/traffic_situation_16.json +++ b/data/baseline_situations_generated/traffic_situation_16.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, OT-SO", "description": "A crossing stand-on and overtaking stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "d58f83cd-3f39-47e6-90a8-079f11ff3a15", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.75206568, - "longitude": 10.40884857 + "lon": 10.43997058, + "lat": 58.75639278 }, "sog": 13.0, - "cog": 47.38, - "heading": 47.38, + "cog": 27.16, + "heading": 27.16, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75206568, - "longitude": 10.40884857 + "lon": 10.43997058, + "lat": 58.75639278 } }, { "position": { - "latitude": 58.77650111, - "longitude": 10.45996974 + "lon": 10.53509529, + "lat": 58.85272352 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "9617c19a-450b-44ba-90ba-bcac297fd9e8", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.72568114, - "longitude": 10.47117898 + "lon": 10.47809115, + "lat": 58.73908438 }, "sog": 15.9, - "cog": 8.77, - "heading": 8.77, + "cog": 5.67, + "heading": 5.67, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72568114, - "longitude": 10.47117898 + "lon": 10.47809115, + "lat": 58.73908438 } }, { "position": { - "latitude": 58.76933391, - "longitude": 10.48413629 + "lon": 10.50330074, + "lat": 58.87094176 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_17.json b/data/baseline_situations_generated/traffic_situation_17.json index 0537374..2df09fb 100644 --- a/data/baseline_situations_generated/traffic_situation_17.json +++ b/data/baseline_situations_generated/traffic_situation_17.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, OT-GW", "description": "A crossing stand-on and overtaking give-way situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,68 +16,79 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "d41038e9-3ffb-4c66-b858-cee2aa9066e5", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.75645562, - "longitude": 10.44043715 + "lon": 10.4597048, + "lat": 58.75913986 }, "sog": 12.1, - "cog": 36.96, - "heading": 36.96, + "cog": 21.72, + "heading": 21.72, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75645562, - "longitude": 10.44043715 + "lon": 10.4597048, + "lat": 58.75913986 } }, { "position": { - "latitude": 58.78314225, - "longitude": 10.47908405 + "lon": 10.53105742, + "lat": 58.85221766 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "6bcfa700-9a3a-4126-9ce3-5b4a25f6daa8", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.76933816, - "longitude": 10.49720327 + "lon": 10.49720327, + "lat": 58.76933816 }, "sog": 8.0, "cog": 351.11, @@ -96,17 +98,31 @@ "waypoints": [ { "position": { - "latitude": 58.76933816, - "longitude": 10.49720327 + "lon": 10.49720327, + "lat": 58.76933816 } }, { "position": { - "latitude": 58.79115714, - "longitude": 10.49063282 + "lon": 10.47749193, + "lat": 58.83479509 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_18.json b/data/baseline_situations_generated/traffic_situation_18.json index 60cfb99..557831f 100644 --- a/data/baseline_situations_generated/traffic_situation_18.json +++ b/data/baseline_situations_generated/traffic_situation_18.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW, OT-GW", "description": "A overtaking give-way and overtaking give-way situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,17 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, - "targetShips": [] + "targetShips": [ + { + "initial": { + "position": { + "lon": 10.49718599, + "lat": 58.77612507 + }, + "sog": 7.0, + "cog": 353.29, + "heading": 353.29, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.49718599, + "lat": 58.77612507 + } + }, + { + "position": { + "lon": 10.48409394, + "lat": 58.83389954 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + }, + { + "initial": { + "position": { + "lon": 10.51106216, + "lat": 58.78618871 + }, + "sog": 6.0, + "cog": 340.45, + "heading": 340.45, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.51106216, + "lat": 58.78618871 + } + }, + { + "position": { + "lon": 10.47879805, + "lat": 58.83339505 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } + } + ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_19.json b/data/baseline_situations_generated/traffic_situation_19.json index 9ddb160..4dc0071 100644 --- a/data/baseline_situations_generated/traffic_situation_19.json +++ b/data/baseline_situations_generated/traffic_situation_19.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW, OT-SO", "description": "A overtaking give-way and overtaking stand-on situation with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "ad6892d7-4529-47c9-95a2-486683723021", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" + "initial": { + "position": { + "lon": 10.50682846, + "lat": 58.78654781 + }, + "sog": 6.0, + "cog": 345.44, + "heading": 345.44, + "navStatus": "Under way using engine" }, + "waypoints": [ + { + "position": { + "lon": 10.50682846, + "lat": 58.78654781 + } + }, + { + "position": { + "lon": 10.48258181, + "lat": 58.83503202 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { "initial": { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49452481, + "lat": 58.74043996 }, "sog": 15.9, - "cog": 357.24, - "heading": 357.24, + "cog": 358.16, + "heading": 358.16, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49452481, + "lat": 58.74043996 } }, { "position": { - "latitude": 58.77350627, - "longitude": 10.49229598 + "lon": 10.48631708, + "lat": 58.87287753 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_20.json b/data/baseline_situations_generated/traffic_situation_20.json index 10dc730..a13059c 100644 --- a/data/baseline_situations_generated/traffic_situation_20.json +++ b/data/baseline_situations_generated/traffic_situation_20.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-SO, OT-SO", "description": "Two overtaking stand-on situations with two target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,113 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "539f6ee2-8f63-4451-8c8d-af739a74d363", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.71787082, - "longitude": 10.52258819 + "lon": 10.51351597, + "lat": 58.73081621 }, "sog": 18.1, - "cog": 347.27, - "heading": 347.27, + "cog": 350.88, + "heading": 350.88, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71787082, - "longitude": 10.52258819 + "lon": 10.51351597, + "lat": 58.73081621 } }, { "position": { - "latitude": 58.76673323, - "longitude": 10.50133988 + "lon": 10.46766204, + "lat": 58.87919758 } } - ] - }, - { + ], "static": { - "id": "177085c1-df1a-4457-b187-807e368383b0", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.73743254, - "longitude": 10.49948429 + "lon": 10.49670214, + "lat": 58.74564685 }, "sog": 15.0, - "cog": 355.12, - "heading": 355.12, + "cog": 356.67, + "heading": 356.67, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.73743254, - "longitude": 10.49948429 + "lon": 10.49670214, + "lat": 58.74564685 } }, { "position": { - "latitude": 58.77875766, - "longitude": 10.4926917 + "lon": 10.48277425, + "lat": 58.86986283 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_21.json b/data/baseline_situations_generated/traffic_situation_21.json index c4c6378..8759444 100644 --- a/data/baseline_situations_generated/traffic_situation_21.json +++ b/data/baseline_situations_generated/traffic_situation_21.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO, HO", "description": "Three head-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,68 +16,79 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "2476955c-9f81-4c26-ab26-1b23004c940f", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.85453354, - "longitude": 10.48453674 + "lon": 10.48286054, + "lat": 58.87941885 }, "sog": 12.1, - "cog": 177.1, - "heading": 177.1, + "cog": 176.36, + "heading": 176.36, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.85453354, - "longitude": 10.48453674 + "lon": 10.48286054, + "lat": 58.87941885 } }, { "position": { - "latitude": 58.8211804, - "longitude": 10.4877876 + "lon": 10.49511607, + "lat": 58.77943375 } } - ] - }, - { + ], "static": { - "id": "71f6c9e8-3da9-42de-b811-c8bc7e2c42a6", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.83510648, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8517326 }, "sog": 9.9, "cog": 180.02, @@ -96,52 +98,71 @@ "waypoints": [ { "position": { - "latitude": 58.83510648, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8517326 } }, { "position": { - "latitude": 58.80763569, - "longitude": 10.49063246 + "lon": 10.49058938, + "lat": 58.76932022 } } - ] - }, - { + ], "static": { - "id": "b866fd23-6db8-4d45-90ab-9a95dabe348c", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.8489137, - "longitude": 10.50216275 + "lon": 10.50363158, + "lat": 58.85991099 }, "sog": 15.0, - "cog": 185.92, - "heading": 185.92, + "cog": 186.67, + "heading": 186.67, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8489137, - "longitude": 10.50216275 + "lon": 10.50363158, + "lat": 58.85991099 } }, { "position": { - "latitude": 58.80765974, - "longitude": 10.49392188 + "lon": 10.4758142, + "lat": 58.73632653 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_22.json b/data/baseline_situations_generated/traffic_situation_22.json index a940725..89f611e 100644 --- a/data/baseline_situations_generated/traffic_situation_22.json +++ b/data/baseline_situations_generated/traffic_situation_22.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO, CR-GW", "description": "Two head-on situations and one grossing give-way situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "b0173d41-3df2-42f2-bf27-065526ec1de3", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.86465105, - "longitude": 10.48044128 + "lon": 10.47793562, + "lat": 58.8894825 }, "sog": 14.0, - "cog": 175.9, - "heading": 175.9, + "cog": 174.87, + "heading": 174.87, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86465105, - "longitude": 10.48044128 + "lon": 10.47793562, + "lat": 58.8894825 } }, { "position": { - "latitude": 58.8259681, - "longitude": 10.4857812 + "lon": 10.49797343, + "lat": 58.77360223 } } - ] - }, - { + ], "static": { - "id": "e1805a47-bc89-4a56-9e90-3b7a99525162", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.84602298, - "longitude": 10.49620101 + "lon": 10.49806729, + "lat": 58.87367333 }, "sog": 9.9, - "cog": 183.0, - "heading": 183.0, + "cog": 184.03, + "heading": 184.03, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84602298, - "longitude": 10.49620101 + "lon": 10.49806729, + "lat": 58.87367333 } }, { "position": { - "latitude": 58.8185899, - "longitude": 10.49343108 + "lon": 10.48690751, + "lat": 58.79146512 } } - ] - }, - { + ], "static": { - "id": "4f043257-85bc-459d-a83b-5792e66cd5f5", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.80894638, - "longitude": 10.5590844 + "lon": 10.56715435, + "lat": 58.81431486 }, "sog": 8.0, - "cog": 243.39, - "heading": 243.39, + "cog": 268.55, + "heading": 268.55, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80894638, - "longitude": 10.5590844 + "lon": 10.56715435, + "lat": 58.81431486 } }, { "position": { - "latitude": 58.79905531, - "longitude": 10.52107659 + "lon": 10.43966607, + "lat": 58.81263294 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_23.json b/data/baseline_situations_generated/traffic_situation_23.json index 5027872..1cf183d 100644 --- a/data/baseline_situations_generated/traffic_situation_23.json +++ b/data/baseline_situations_generated/traffic_situation_23.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO, CR-SO", "description": "Two head-on situations and one grossing stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "04d3643f-f8f5-4c59-ba7a-920dd5456ba8", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.8570113, - "longitude": 10.50641373 + "lon": 10.50917859, + "lat": 58.87343991 }, "sog": 15.0, - "cog": 187.07, - "heading": 187.07, + "cog": 188.33, + "heading": 188.33, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8570113, - "longitude": 10.50641373 + "lon": 10.50917859, + "lat": 58.87343991 } }, { "position": { - "latitude": 58.81585121, - "longitude": 10.49658643 + "lon": 10.4744752, + "lat": 58.75032644 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "45d1235f-1400-41d3-9647-4becc5eecd9d", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.86120374, - "longitude": 10.49722055 + "lon": 10.49766984, + "lat": 58.86774825 }, - "sog": 18.1, - "cog": 182.77, - "heading": 182.77, + "sog": 16.9, + "cog": 183.17, + "heading": 183.17, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86120374, - "longitude": 10.49722055 + "lon": 10.49766984, + "lat": 58.86774825 } }, { "position": { - "latitude": 58.81116861, - "longitude": 10.49255471 + "lon": 10.48268367, + "lat": 58.72737815 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "255db573-6ffa-4cdd-abc4-3224113581ef", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_3", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.80382927, - "longitude": 10.43207343 + "lon": 10.42758053, + "lat": 58.80692647 }, "sog": 7.0, - "cog": 112.59, - "heading": 112.59, + "cog": 83.71, + "heading": 83.71, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80382927, - "longitude": 10.43207343 + "lon": 10.42758053, + "lat": 58.80692647 } }, { "position": { - "latitude": 58.79638166, - "longitude": 10.46653633 + "lon": 10.53888327, + "lat": 58.81330088 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_24.json b/data/baseline_situations_generated/traffic_situation_24.json index fee9129..5231132 100644 --- a/data/baseline_situations_generated/traffic_situation_24.json +++ b/data/baseline_situations_generated/traffic_situation_24.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO, OT-GW", "description": "Two head-on situations and one overtaking give-way situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "0f826cad-825d-4867-974a-f567c33f120c", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.84442501, - "longitude": 10.48248037 + "lon": 10.48082145, + "lat": 58.86097033 }, "sog": 12.1, - "cog": 175.44, - "heading": 175.44, + "cog": 174.52, + "heading": 174.52, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84442501, - "longitude": 10.48248037 + "lon": 10.48082145, + "lat": 58.86097033 } }, { "position": { - "latitude": 58.81113486, - "longitude": 10.48759143 + "lon": 10.49922836, + "lat": 58.76124012 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { + "initial": { + "position": { + "lon": 10.49715143, + "lat": 58.86020725 + }, + "sog": 15.0, + "cog": 183.35, + "heading": 183.35, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.49715143, + "lat": 58.86020725 + } + }, + { + "position": { + "lon": 10.48317045, + "lat": 58.73599288 + } + } + ], "static": { - "id": "a4401792-fd27-4b8d-8243-125b7be5a811", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, + "id": 10, "name": "target_ship_2", - "shipType": "Passenger" - }, + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + }, + { "initial": { "position": { - "latitude": 58.86120374, - "longitude": 10.49722055 + "lon": 10.49813641, + "lat": 58.79112628 }, - "sog": 18.1, - "cog": 182.77, - "heading": 182.77, + "sog": 5.1, + "cog": 352.03, + "heading": 352.03, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86120374, - "longitude": 10.49722055 + "lon": 10.49813641, + "lat": 58.79112628 } }, { "position": { - "latitude": 58.81116861, - "longitude": 10.49255471 + "lon": 10.48691649, + "lat": 58.83273413 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_25.json b/data/baseline_situations_generated/traffic_situation_25.json index a61d739..2595f7a 100644 --- a/data/baseline_situations_generated/traffic_situation_25.json +++ b/data/baseline_situations_generated/traffic_situation_25.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, HO, OT-SO", "description": "Two head-on situations and one overtaking stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,68 +16,79 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "d5cb10ba-1303-42ff-b8a9-ee1009e8d858", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.8704684, - "longitude": 10.47624214 + "lon": 10.47365008, + "lat": 58.88972489 }, "sog": 16.9, - "cog": 174.58, - "heading": 174.58, + "cog": 173.61, + "heading": 173.61, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8704684, - "longitude": 10.47624214 + "lon": 10.47365008, + "lat": 58.88972489 } }, { "position": { - "latitude": 58.82381595, - "longitude": 10.48476203 + "lon": 10.50378566, + "lat": 58.75001349 } } - ] - }, - { + ], "static": { - "id": "6b037b0a-96bc-4a08-966f-42c4d2456d77", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.84528684, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85914792 }, "sog": 13.0, "cog": 180.02, @@ -96,52 +98,71 @@ "waypoints": [ { "position": { - "latitude": 58.84528684, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85914792 } }, { "position": { - "latitude": 58.80919775, - "longitude": 10.4906257 + "lon": 10.49056911, + "lat": 58.75088067 } } - ] - }, - { + ], "static": { - "id": "1567f3cd-9ee4-43ef-9511-9f80e6e726cc", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.72882323, - "longitude": 10.51230635 + "lon": 10.50473753, + "lat": 58.7409427 }, - "sog": 19.1, - "cog": 349.79, - "heading": 349.79, + "sog": 16.9, + "cog": 352.54, + "heading": 352.54, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72882323, - "longitude": 10.51230635 + "lon": 10.50473753, + "lat": 58.7409427 } }, { "position": { - "latitude": 58.78077447, - "longitude": 10.49429681 + "lon": 10.46960737, + "lat": 58.88033888 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_26.json b/data/baseline_situations_generated/traffic_situation_26.json index e9a0cd4..56ce0fa 100644 --- a/data/baseline_situations_generated/traffic_situation_26.json +++ b/data/baseline_situations_generated/traffic_situation_26.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-GW, CR-GW", "description": "Head-on situation and two grossing give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "ef4fb9a9-90b4-444c-af6c-1dc2d9c79fcc", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.87390674, - "longitude": 10.50179986 + "lon": 10.50458201, + "lat": 58.90150322 }, "sog": 15.0, - "cog": 183.98, - "heading": 183.98, + "cog": 185.01, + "heading": 185.01, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.87390674, - "longitude": 10.50179986 + "lon": 10.50458201, + "lat": 58.90150322 } }, { "position": { - "latitude": 58.83253108, - "longitude": 10.49626314 + "lon": 10.48367403, + "lat": 58.77755168 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "84b31640-140b-4241-9fca-3b2305416104", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.84922791, - "longitude": 10.55075524 + "lon": 10.56188382, + "lat": 58.86511788 }, "sog": 14.0, - "cog": 208.27, - "heading": 208.27, + "cog": 214.17, + "heading": 214.17, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84922791, - "longitude": 10.55075524 + "lon": 10.56188382, + "lat": 58.86511788 } }, { "position": { - "latitude": 58.8150714, - "longitude": 10.51539816 + "lon": 10.43609474, + "lat": 58.76885724 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "802e3beb-a8ed-43d8-853d-d83a3fc2eb53", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.75759575, - "longitude": 10.54367028 + "lon": 10.52431623, + "lat": 58.75973236 }, "sog": 12.1, - "cog": 320.63, - "heading": 320.63, + "cog": 336.27, + "heading": 336.27, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75759575, - "longitude": 10.54367028 + "lon": 10.52431623, + "lat": 58.75973236 } }, { "position": { - "latitude": 58.78341191, - "longitude": 10.5028914 + "lon": 10.44670513, + "lat": 58.85144856 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_27.json b/data/baseline_situations_generated/traffic_situation_27.json index 0326387..1e31d62 100644 --- a/data/baseline_situations_generated/traffic_situation_27.json +++ b/data/baseline_situations_generated/traffic_situation_27.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-GW, CR-SO", "description": "Head-on, crossing give-way and crossing stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "998c5fc4-a825-44de-9986-11f0a73b317a", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.86863701, - "longitude": 10.48358631 + "lon": 10.48172003, + "lat": 58.89628736 }, "sog": 14.0, - "cog": 177.27, - "heading": 177.27, + "cog": 176.59, + "heading": 176.59, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86863701, - "longitude": 10.48358631 + "lon": 10.48172003, + "lat": 58.89628736 } }, { "position": { - "latitude": 58.82989863, - "longitude": 10.48713783 + "lon": 10.49505815, + "lat": 58.78014698 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "fc185b8f-ea19-42b9-bd97-ea94e5b5c0a0", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.81497919, - "longitude": 10.58984352 + "lon": 10.59857012, + "lat": 58.81951277 }, "sog": 12.1, - "cog": 245.17, - "heading": 245.17, + "cog": 260.92, + "heading": 260.92, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81497919, - "longitude": 10.58984352 + "lon": 10.59857012, + "lat": 58.81951277 } }, { "position": { - "latitude": 58.80095463, - "longitude": 10.53150353 + "lon": 10.40813477, + "lat": 58.80371042 } } - ] - }, - { + ], "static": { - "id": "d9f16645-c474-4b7d-9e75-e10114034e75", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.75609652, - "longitude": 10.40129703 + "lon": 10.42464286, + "lat": 58.75801768 }, "sog": 14.0, - "cog": 52.94, - "heading": 52.94, + "cog": 36.1, + "heading": 36.1, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75609652, - "longitude": 10.40129703 + "lon": 10.42464286, + "lat": 58.75801768 } }, { "position": { - "latitude": 58.77946801, - "longitude": 10.46087019 + "lon": 10.5565842, + "lat": 58.85202918 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_28.json b/data/baseline_situations_generated/traffic_situation_28.json index f160d8a..24ac0ec 100644 --- a/data/baseline_situations_generated/traffic_situation_28.json +++ b/data/baseline_situations_generated/traffic_situation_28.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-GW, OT-GW", "description": "Head-on, crossing give-way and overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "c0b0771c-7ee1-41c1-b3c8-4658a9da6564", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.8577654, - "longitude": 10.4811325 + "lon": 10.47835035, + "lat": 58.8853529 }, "sog": 12.1, - "cog": 175.73, - "heading": 175.73, + "cog": 174.52, + "heading": 174.52, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8577654, - "longitude": 10.4811325 + "lon": 10.47835035, + "lat": 58.8853529 } }, { "position": { - "latitude": 58.8244624, - "longitude": 10.4859231 + "lon": 10.49675727, + "lat": 58.7856227 } } - ] - }, - { + ], "static": { - "id": "cf24a238-7713-4257-90af-b225944261d2", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.8080666, - "longitude": 10.61331031 + "lon": 10.61754401, + "lat": 58.80961071 }, "sog": 14.0, - "cog": 255.14, - "heading": 255.14, + "cog": 270.84, + "heading": 270.84, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8080666, - "longitude": 10.61331031 + "lon": 10.61754401, + "lat": 58.80961071 } }, { "position": { - "latitude": 58.79811933, - "longitude": 10.54115628 + "lon": 10.39361388, + "lat": 58.8113106 } } - ] - }, - { + ], "static": { - "id": "e49e0040-72fa-482e-bda5-06aa7db0b932", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.76616017, - "longitude": 10.49366079 + "lon": 10.51183978, + "lat": 58.78250799 }, "sog": 6.0, - "cog": 356.44, - "heading": 356.44, + "cog": 333.92, + "heading": 333.92, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76616017, - "longitude": 10.49366079 + "lon": 10.51183978, + "lat": 58.78250799 } }, { "position": { - "latitude": 58.78282583, - "longitude": 10.49166335 + "lon": 10.46944872, + "lat": 58.82750122 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_29.json b/data/baseline_situations_generated/traffic_situation_29.json index 8ea6a04..8dff346 100644 --- a/data/baseline_situations_generated/traffic_situation_29.json +++ b/data/baseline_situations_generated/traffic_situation_29.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-GW, OT-SO", "description": "Head-on, crossing give-way and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "27e1dfe2-84c0-40ef-8eec-00c51292cf5b", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.8357349, - "longitude": 10.48821746 + "lon": 10.48747441, + "lat": 58.85789108 }, "sog": 8.9, - "cog": 178.36, - "heading": 178.36, + "cog": 177.9, + "heading": 177.9, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8357349, - "longitude": 10.48821746 + "lon": 10.48747441, + "lat": 58.85789108 } }, { "position": { - "latitude": 58.81096745, - "longitude": 10.48958097 + "lon": 10.49270898, + "lat": 58.7836081 } } - ] - }, - { + ], "static": { - "id": "11fe718f-33ff-4730-a1e6-07fdf11fbaba", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.77486823, - "longitude": 10.61533211 + "lon": 10.58189453, + "lat": 58.77180694 }, "sog": 12.1, - "cog": 284.13, - "heading": 284.13, + "cog": 314.78, + "heading": 314.78, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.77486823, - "longitude": 10.61533211 + "lon": 10.58189453, + "lat": 58.77180694 } }, { "position": { - "latitude": 58.7830208, - "longitude": 10.55299388 + "lon": 10.44501402, + "lat": 58.84238148 } } - ] - }, - { + ], "static": { - "id": "8e13b629-9bf1-41de-8998-260cd09d5df9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.72454999, - "longitude": 10.44741843 + "lon": 10.46886341, + "lat": 58.74383342 }, - "sog": 16.9, - "cog": 18.62, - "heading": 18.62, + "sog": 15.0, + "cog": 10.49, + "heading": 10.49, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72454999, - "longitude": 10.44741843 + "lon": 10.46886341, + "lat": 58.74383342 } }, { "position": { - "latitude": 58.76895875, - "longitude": 10.47622127 + "lon": 10.51244886, + "lat": 58.86618231 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_30.json b/data/baseline_situations_generated/traffic_situation_30.json index d85e609..05599fd 100644 --- a/data/baseline_situations_generated/traffic_situation_30.json +++ b/data/baseline_situations_generated/traffic_situation_30.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-SO, CR-SO", "description": "Head-on and two crossing stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "8520e779-44a3-4190-9e8b-63c75f889eef", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.82867867, - "longitude": 10.49284861 + "lon": 10.49350527, + "lat": 58.84806982 }, "sog": 8.0, - "cog": 181.74, - "heading": 181.74, + "cog": 182.26, + "heading": 182.26, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.82867867, - "longitude": 10.49284861 + "lon": 10.49350527, + "lat": 58.84806982 } }, { "position": { - "latitude": 58.80660452, - "longitude": 10.4915562 + "lon": 10.48848097, + "lat": 58.78186817 } } - ] - }, - { + ], "static": { - "id": "240454f8-9218-46e1-b80f-987c3229eaf0", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.76852122, - "longitude": 10.37910899 + "lon": 10.39466136, + "lat": 58.76781201 }, "sog": 15.0, - "cog": 68.64, - "heading": 68.64, + "cog": 53.29, + "heading": 53.29, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76852122, - "longitude": 10.37910899 + "lon": 10.39466136, + "lat": 58.76781201 } }, { "position": { - "latitude": 58.78362748, - "longitude": 10.45346076 + "lon": 10.58665446, + "lat": 58.84219843 } } - ] - }, - { + ], "static": { - "id": "9a70b67e-fd41-464e-823b-fb6477bd4cf1", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.74969565, - "longitude": 10.34050457 + "lon": 10.37722543, + "lat": 58.75306217 }, "sog": 15.9, - "cog": 61.99, - "heading": 61.99, + "cog": 41.83, + "heading": 41.83, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.74969565, - "longitude": 10.34050457 + "lon": 10.37722543, + "lat": 58.75306217 } }, { "position": { - "latitude": 58.77043567, - "longitude": 10.41556825 + "lon": 10.54731637, + "lat": 58.85180239 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_31.json b/data/baseline_situations_generated/traffic_situation_31.json index d9147df..0a120a5 100644 --- a/data/baseline_situations_generated/traffic_situation_31.json +++ b/data/baseline_situations_generated/traffic_situation_31.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-SO, OT-SO", "description": "Head-on, crossing stand-on and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,33 +16,39 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "ed95fb1e-dae4-4e28-aec8-c93add0a84d9", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.82454908, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85226226 }, "sog": 6.0, "cog": 180.02, @@ -61,87 +58,111 @@ "waypoints": [ { "position": { - "latitude": 58.82454908, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.85226226 } }, { "position": { - "latitude": 58.80785114, - "longitude": 10.49064091 + "lon": 10.49061472, + "lat": 58.80216846 } } - ] - }, - { + ], "static": { - "id": "d88a524d-737c-47ad-9689-cc095699577d", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.75563868, - "longitude": 10.40539249 + "lon": 10.44411787, + "lat": 58.75918474 }, "sog": 12.1, - "cog": 51.28, - "heading": 51.28, + "cog": 25.21, + "heading": 25.21, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75563868, - "longitude": 10.40539249 + "lon": 10.44411787, + "lat": 58.75918474 } }, { "position": { - "latitude": 58.77652842, - "longitude": 10.45554675 + "lon": 10.52626, + "lat": 58.84982965 } } - ] - }, - { + ], "static": { - "id": "bc51aa50-f656-4849-92de-911011317e96", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.72339191, - "longitude": 10.45469348 + "lon": 10.46592574, + "lat": 58.73589741 }, "sog": 16.9, - "cog": 15.41, - "heading": 15.41, + "cog": 10.54, + "heading": 10.54, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72339191, - "longitude": 10.45469348 + "lon": 10.46592574, + "lat": 58.73589741 } }, { "position": { - "latitude": 58.76856857, - "longitude": 10.4786667 + "lon": 10.5154377, + "lat": 58.87411012 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_32.json b/data/baseline_situations_generated/traffic_situation_32.json index 5939a09..b8a0ec4 100644 --- a/data/baseline_situations_generated/traffic_situation_32.json +++ b/data/baseline_situations_generated/traffic_situation_32.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, CR-SO, OT-GW", "description": "Head-on, crossing stand-on and overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "1e2e1ff0-b0f3-4d05-bdba-d57d1f368315", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.81915367, - "longitude": 10.48878772 + "lon": 10.48785457, + "lat": 58.84683992 }, "sog": 5.1, - "cog": 178.02, - "heading": 178.02, + "cog": 177.04, + "heading": 177.04, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81915367, - "longitude": 10.48878772 + "lon": 10.48785457, + "lat": 58.84683992 } }, { "position": { - "latitude": 58.80515733, - "longitude": 10.48972006 + "lon": 10.49202514, + "lat": 58.80488167 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { + "initial": { + "position": { + "lon": 10.44855894, + "lat": 58.75548606 + }, + "sog": 13.0, + "cog": 23.84, + "heading": 23.84, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.44855894, + "lat": 58.75548606 + } + }, + { + "position": { + "lon": 10.53277506, + "lat": 58.85451949 + } + } + ], "static": { - "id": "2d63203e-8e3c-45de-adb1-bdaae9a15b76", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, + "id": 10, "name": "target_ship_2", - "shipType": "Passenger" - }, + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + }, + { "initial": { "position": { - "latitude": 58.75045872, - "longitude": 10.42194711 + "lon": 10.50447832, + "lat": 58.77370117 }, - "sog": 13.0, - "cog": 41.25, - "heading": 41.25, + "sog": 8.0, + "cog": 348.99, + "heading": 348.99, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75045872, - "longitude": 10.42194711 + "lon": 10.50447832, + "lat": 58.77370117 } }, { "position": { - "latitude": 58.77759071, - "longitude": 10.46775274 + "lon": 10.48011965, + "lat": 58.8387345 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_33.json b/data/baseline_situations_generated/traffic_situation_33.json index 4f8baae..3790e4a 100644 --- a/data/baseline_situations_generated/traffic_situation_33.json +++ b/data/baseline_situations_generated/traffic_situation_33.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, OT-GW, OT-GW", "description": "Head-on and two overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { + "initial": { + "position": { + "lon": 10.50064207, + "lat": 58.8624875 + }, + "sog": 11.1, + "cog": 185.7, + "heading": 185.7, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.50064207, + "lat": 58.8624875 + } + }, + { + "position": { + "lon": 10.48304647, + "lat": 58.77083426 + } + } + ], "static": { - "id": "81ced22a-66b2-4ce9-9a8b-1789c344db58", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, + "id": 10, "name": "target_ship_1", - "shipType": "Cargo" + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { + "initial": { + "position": { + "lon": 10.51135592, + "lat": 58.79300255 + }, + "sog": 5.1, + "cog": 337.41, + "heading": 337.41, + "navStatus": "Under way using engine" }, + "waypoints": [ + { + "position": { + "lon": 10.51135592, + "lat": 58.79300255 + } + }, + { + "position": { + "lon": 10.48029643, + "lat": 58.83179463 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + }, + { "initial": { "position": { - "latitude": 58.84318613, - "longitude": 10.49868939 + "lon": 10.50478937, + "lat": 58.77920431 }, - "sog": 11.1, - "cog": 184.61, - "heading": 184.61, + "sog": 7.0, + "cog": 347.84, + "heading": 347.84, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84318613, - "longitude": 10.49868939 + "lon": 10.50478937, + "lat": 58.77920431 } }, { "position": { - "latitude": 58.81258267, - "longitude": 10.49394251 + "lon": 10.48120738, + "lat": 58.83607311 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_34.json b/data/baseline_situations_generated/traffic_situation_34.json index bd30cc3..3aea438 100644 --- a/data/baseline_situations_generated/traffic_situation_34.json +++ b/data/baseline_situations_generated/traffic_situation_34.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, OT-GW, OT-SO", "description": "Head-on, overtaking give-way and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "5ea95fa3-78dc-4564-b2b9-68faf45e3239", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.85233408, - "longitude": 10.48168547 + "lon": 10.47973278, + "lat": 58.87164444 }, "sog": 13.0, - "cog": 175.67, - "heading": 175.67, + "cog": 174.69, + "heading": 174.69, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.85233408, - "longitude": 10.48168547 + "lon": 10.47973278, + "lat": 58.87164444 } }, { "position": { - "latitude": 58.81634806, - "longitude": 10.48693168 + "lon": 10.49900169, + "lat": 58.76384096 } } - ] - }, - { + ], "static": { - "id": "fce4c5d5-6917-4bc1-80ae-6ca68899b04c", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.76444549, - "longitude": 10.49134522 + "lon": 10.50359702, + "lat": 58.78192446 }, "sog": 6.0, - "cog": 359.24, - "heading": 359.24, + "cog": 345.44, + "heading": 345.44, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76444549, - "longitude": 10.49134522 + "lon": 10.50359702, + "lat": 58.78192446 } }, { "position": { - "latitude": 58.78114197, - "longitude": 10.49092143 + "lon": 10.47935037, + "lat": 58.83040867 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "38e96e64-0cd3-411b-a88a-cfcbdce86336", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49390272, + "lat": 58.74420149 }, - "sog": 15.9, - "cog": 357.24, - "heading": 357.24, + "sog": 15.0, + "cog": 358.33, + "heading": 358.33, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49390272, + "lat": 58.74420149 } }, { "position": { - "latitude": 58.77350627, - "longitude": 10.49229598 + "lon": 10.48691364, + "lat": 58.86857505 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_35.json b/data/baseline_situations_generated/traffic_situation_35.json index 879cf26..2ce2465 100644 --- a/data/baseline_situations_generated/traffic_situation_35.json +++ b/data/baseline_situations_generated/traffic_situation_35.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "HO, OT-SO, OT-SO", "description": "Head-on and two overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "1077425c-1cc8-4b98-9524-56c14fe438fd", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.84160611, - "longitude": 10.49590724 + "lon": 10.4966503, + "lat": 58.85266625 }, "sog": 13.0, - "cog": 183.12, - "heading": 183.12, + "cog": 183.52, + "heading": 183.52, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84160611, - "longitude": 10.49590724 + "lon": 10.4966503, + "lat": 58.85266625 } }, { "position": { - "latitude": 58.80557042, - "longitude": 10.49212958 + "lon": 10.48386095, + "lat": 58.74460306 } } - ] - }, - { + ], "static": { - "id": "2c9124e8-7f4e-4252-b6da-75add867bf49", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.71040164, - "longitude": 10.53826151 + "lon": 10.5170239, + "lat": 58.73406602 }, - "sog": 19.1, - "cog": 342.97, - "heading": 342.97, + "sog": 16.9, + "cog": 349.45, + "heading": 349.45, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71040164, - "longitude": 10.53826151 + "lon": 10.5170239, + "lat": 58.73406602 } }, { "position": { - "latitude": 58.76087471, - "longitude": 10.50850741 + "lon": 10.46746264, + "lat": 58.87227396 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "c87e4c51-62d1-49d5-acbd-4e38288c502c", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_3", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.71695513, - "longitude": 10.50643101 + "lon": 10.49901772, + "lat": 58.7387971 }, "sog": 15.0, - "cog": 353.69, - "heading": 353.69, + "cog": 356.67, + "heading": 356.67, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71695513, - "longitude": 10.50643101 + "lon": 10.49901772, + "lat": 58.7387971 } }, { "position": { - "latitude": 58.75817912, - "longitude": 10.4976521 + "lon": 10.48508982, + "lat": 58.86301308 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_36.json b/data/baseline_situations_generated/traffic_situation_36.json index 08d4bf2..9a8b72c 100644 --- a/data/baseline_situations_generated/traffic_situation_36.json +++ b/data/baseline_situations_generated/traffic_situation_36.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-GW, CR-GW", "description": "Three crossing give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "eadae5c5-0658-44a0-bf78-6ff4ad48dd3a", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.84495467, - "longitude": 10.53269722 + "lon": 10.53781222, + "lat": 58.85488366 }, "sog": 15.0, - "cog": 202.08, - "heading": 202.08, + "cog": 204.95, + "heading": 204.95, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84495467, - "longitude": 10.53269722 + "lon": 10.53781222, + "lat": 58.85488366 } }, { "position": { - "latitude": 58.80652158, - "longitude": 10.50268415 + "lon": 10.43679327, + "lat": 58.74206632 } } - ] - }, - { + ], "static": { - "id": "0d33a880-a4ed-4542-ac7b-c1820d0354af", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.83445113, - "longitude": 10.58635288 + "lon": 10.59965879, + "lat": 58.84431728 }, "sog": 14.0, - "cog": 228.95, - "heading": 228.95, + "cog": 239.21, + "heading": 239.21, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83445113, - "longitude": 10.58635288 + "lon": 10.59965879, + "lat": 58.84431728 } }, { "position": { - "latitude": 58.80898413, - "longitude": 10.53005219 + "lon": 10.40727148, + "lat": 58.78475991 } } - ] - }, - { + ], "static": { - "id": "b3afe993-0cb1-4d15-90f5-e57f6d0b3723", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.75851144, - "longitude": 10.53539297 + "lon": 10.52172417, + "lat": 58.76001964 }, "sog": 12.1, - "cog": 324.52, - "heading": 324.52, + "cog": 336.27, + "heading": 336.27, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75851144, - "longitude": 10.53539297 + "lon": 10.52172417, + "lat": 58.76001964 } }, { "position": { - "latitude": 58.78570742, - "longitude": 10.49808486 + "lon": 10.44411307, + "lat": 58.85173583 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_37.json b/data/baseline_situations_generated/traffic_situation_37.json index 7923189..a9e94cb 100644 --- a/data/baseline_situations_generated/traffic_situation_37.json +++ b/data/baseline_situations_generated/traffic_situation_37.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-GW, CR-SO", "description": "Two crossing give-waysituations and one crossing give-way situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "920192ea-f1fe-4be2-af92-e9ccacd60797", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.76932919, - "longitude": 10.62003238 + "lon": 10.59304039, + "lat": 58.76809929 }, - "sog": 15.9, - "cog": 287.97, - "heading": 287.97, + "sog": 15.0, + "cog": 306.7, + "heading": 306.7, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.76932919, - "longitude": 10.62003238 + "lon": 10.59304039, + "lat": 58.76809929 } }, { "position": { - "latitude": 58.78295504, - "longitude": 10.53915956 + "lon": 10.40102076, + "lat": 58.84246722 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "4c8d2478-9b8c-4aa6-b67d-138b774698ce", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.81748388, - "longitude": 10.59466475 + "lon": 10.60491203, + "lat": 58.82280747 }, "sog": 12.1, - "cog": 244.02, - "heading": 244.02, + "cog": 260.92, + "heading": 260.92, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81748388, - "longitude": 10.59466475 + "lon": 10.60491203, + "lat": 58.82280747 } }, { "position": { - "latitude": 58.802856, - "longitude": 10.53687631 + "lon": 10.41447668, + "lat": 58.80700512 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "8e02d550-8acc-4622-acc8-ef330ee9593e", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.75193999, - "longitude": 10.40794999 + "lon": 10.43238448, + "lat": 58.75533344 }, "sog": 14.0, - "cog": 47.61, - "heading": 47.61, + "cog": 31.34, + "heading": 31.34, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.75193999, - "longitude": 10.40794999 + "lon": 10.43238448, + "lat": 58.75533344 } }, { "position": { - "latitude": 58.7780846, - "longitude": 10.46308791 + "lon": 10.54886909, + "lat": 58.85470402 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_38.json b/data/baseline_situations_generated/traffic_situation_38.json index 17848a8..3fb32dd 100644 --- a/data/baseline_situations_generated/traffic_situation_38.json +++ b/data/baseline_situations_generated/traffic_situation_38.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-GW, OT-GW", "description": "Two crossing give-waysituations and one overtaking give-way situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "0f1edcd0-c5a7-40b5-ac23-18036cd001d8", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.85631106, - "longitude": 10.5189593 + "lon": 10.52708109, + "lat": 58.88292003 }, "sog": 12.1, - "cog": 192.74, - "heading": 192.74, + "cog": 196.47, + "heading": 196.47, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.85631106, - "longitude": 10.5189593 + "lon": 10.52708109, + "lat": 58.88292003 } }, { "position": { - "latitude": 58.82373776, - "longitude": 10.50477984 + "lon": 10.4724147, + "lat": 58.78684191 } } - ] - }, - { + ], "static": { - "id": "a16a6a0e-7afc-4d98-ba84-00778780a143", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.82181995, - "longitude": 10.60301119 + "lon": 10.61343127, + "lat": 58.82723332 }, "sog": 14.0, - "cog": 242.3, - "heading": 242.3, + "cog": 255.37, + "heading": 255.37, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.82181995, - "longitude": 10.60301119 + "lon": 10.61343127, + "lat": 58.82723332 } }, { "position": { - "latitude": 58.80379462, - "longitude": 10.53691303 + "lon": 10.39674116, + "lat": 58.79784155 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "cf1ee3ce-adb2-4626-8a9c-998626f22f44", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_3", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.77098103, - "longitude": 10.49592452 + "lon": 10.51418991, + "lat": 58.79704237 }, "sog": 4.1, - "cog": 352.25, - "heading": 352.25, + "cog": 323.09, + "heading": 323.09, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.77098103, - "longitude": 10.49592452 + "lon": 10.51418991, + "lat": 58.79704237 } }, { "position": { - "latitude": 58.78218933, - "longitude": 10.49299005 + "lon": 10.47496221, + "lat": 58.82417605 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_39.json b/data/baseline_situations_generated/traffic_situation_39.json index d1d314a..12d1b44 100644 --- a/data/baseline_situations_generated/traffic_situation_39.json +++ b/data/baseline_situations_generated/traffic_situation_39.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-GW, OT-SO", "description": "Two crossing give-waysituations and one overtaking stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "a80e778a-6544-4676-89d6-f5aed89cd25d", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.87899691, - "longitude": 10.52986324 + "lon": 10.53511648, + "lat": 58.89444699 }, - "sog": 18.1, - "cog": 193.03, - "heading": 193.03, + "sog": 16.9, + "cog": 195.89, + "heading": 195.89, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.87899691, - "longitude": 10.52986324 + "lon": 10.53511648, + "lat": 58.89444699 } }, { "position": { - "latitude": 58.83019281, - "longitude": 10.50812407 + "lon": 10.46100609, + "lat": 58.75923593 } } - ] - }, - { + ], "static": { - "id": "1345fe0c-5885-4cb9-ae57-5c349fe9be11", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.77486823, - "longitude": 10.61533211 + "lon": 10.58189453, + "lat": 58.77180694 }, "sog": 12.1, - "cog": 284.13, - "heading": 284.13, + "cog": 314.78, + "heading": 314.78, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.77486823, - "longitude": 10.61533211 + "lon": 10.58189453, + "lat": 58.77180694 } }, { "position": { - "latitude": 58.7830208, - "longitude": 10.55299388 + "lon": 10.44501402, + "lat": 58.84238148 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "454cb381-b56f-40cc-aa9c-78f9b3574edf", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.71663194, - "longitude": 10.47475603 + "lon": 10.48032032, + "lat": 58.73299771 }, "sog": 16.9, - "cog": 6.3, - "heading": 6.3, + "cog": 4.13, + "heading": 4.13, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71663194, - "longitude": 10.47475603 + "lon": 10.48032032, + "lat": 58.73299771 } }, { "position": { - "latitude": 58.76321066, - "longitude": 10.48465844 + "lon": 10.49978749, + "lat": 58.87321931 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_40.json b/data/baseline_situations_generated/traffic_situation_40.json index 13d92e7..3d962f5 100644 --- a/data/baseline_situations_generated/traffic_situation_40.json +++ b/data/baseline_situations_generated/traffic_situation_40.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-SO, CR-SO", "description": "One crossing give way and two crossing stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "21f9af18-98f6-482f-870b-d99f4f144427", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.82287031, - "longitude": 10.51082023 + "lon": 10.5195814, + "lat": 58.84868926 }, "sog": 6.0, - "cog": 198.3, - "heading": 198.3, + "cog": 206.72, + "heading": 206.72, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.82287031, - "longitude": 10.51082023 + "lon": 10.5195814, + "lat": 58.84868926 } }, { "position": { - "latitude": 58.80701693, - "longitude": 10.50072766 + "lon": 10.47622113, + "lat": 58.803946 } } - ] - }, - { + ], "static": { - "id": "7ad158eb-ceab-4d30-aaa9-17084ecbbff4", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.7798417, - "longitude": 10.37290533 + "lon": 10.38228859, + "lat": 58.77853101 }, "sog": 15.0, - "cog": 79.53, - "heading": 79.53, + "cog": 64.8, + "heading": 64.8, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7798417, - "longitude": 10.37290533 + "lon": 10.38228859, + "lat": 58.77853101 } }, { "position": { - "latitude": 58.78738112, - "longitude": 10.45141067 + "lon": 10.59900317, + "lat": 58.83150625 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "df6b438d-f1c6-46aa-86ca-811ad4a42720", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.74116713, - "longitude": 10.24739775 + "lon": 10.34539493, + "lat": 58.75014452 }, - "sog": 16.9, - "cog": 68.41, - "heading": 68.41, + "sog": 15.0, + "cog": 38.85, + "heading": 38.85, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.74116713, - "longitude": 10.24739775 + "lon": 10.34539493, + "lat": 58.75014452 } }, { "position": { - "latitude": 58.75840968, - "longitude": 10.33127351 + "lon": 10.49562211, + "lat": 58.84705149 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_41.json b/data/baseline_situations_generated/traffic_situation_41.json index 18caeb1..c1df6f1 100644 --- a/data/baseline_situations_generated/traffic_situation_41.json +++ b/data/baseline_situations_generated/traffic_situation_41.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-SO, OT-SO", "description": "Crossing give way, crossing stand-on and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "90ad61e9-0bde-404c-8de7-717fbebdec37", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.79163799, - "longitude": 10.69314577 + "lon": 10.64237595, + "lat": 58.78456381 }, - "sog": 18.1, - "cog": 269.75, - "heading": 269.75, + "sog": 15.0, + "cog": 295.19, + "heading": 295.19, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.79163799, - "longitude": 10.69314577 + "lon": 10.64237595, + "lat": 58.78456381 } }, { "position": { - "latitude": 58.79141813, - "longitude": 10.59672205 + "lon": 10.42564247, + "lat": 58.83751819 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "c356120c-0dd7-400a-88f8-a657e8dda6c5", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.83445113, - "longitude": 10.39495512 + "lon": 10.38164921, + "lat": 58.84431728 }, "sog": 14.0, - "cog": 131.04, - "heading": 131.04, + "cog": 120.78, + "heading": 120.78, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83445113, - "longitude": 10.39495512 + "lon": 10.38164921, + "lat": 58.84431728 } }, { "position": { - "latitude": 58.80898955, - "longitude": 10.4512649 + "lon": 10.57405776, + "lat": 58.78477843 } } - ] - }, - { + ], "static": { - "id": "e873f7d1-1ec4-47b3-b5a3-626c428b46e7", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.72339191, - "longitude": 10.45469348 + "lon": 10.46592574, + "lat": 58.73589741 }, "sog": 16.9, - "cog": 15.41, - "heading": 15.41, + "cog": 10.54, + "heading": 10.54, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.72339191, - "longitude": 10.45469348 + "lon": 10.46592574, + "lat": 58.73589741 } }, { "position": { - "latitude": 58.76856857, - "longitude": 10.4786667 + "lon": 10.5154377, + "lat": 58.87411012 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_42.json b/data/baseline_situations_generated/traffic_situation_42.json index 7c2fb18..16548c1 100644 --- a/data/baseline_situations_generated/traffic_situation_42.json +++ b/data/baseline_situations_generated/traffic_situation_42.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, CR-SO, OT-GW", "description": "Crossing give way, crossing stand-on and overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,103 +16,119 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "4fe4ef8c-3048-440c-bde9-e2ae099fc8d9", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_1", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.80563373, - "longitude": 10.57185462 + "lon": 10.57581183, + "lat": 58.80768955 }, "sog": 8.9, - "cog": 251.07, - "heading": 251.07, + "cog": 277.25, + "heading": 277.25, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80563373, - "longitude": 10.57185462 + "lon": 10.57581183, + "lat": 58.80768955 } }, { "position": { - "latitude": 58.79759561, - "longitude": 10.52674017 + "lon": 10.43387538, + "lat": 58.81707577 } } - ] - }, - { + ], "static": { - "id": "3b208654-1cb8-4f44-b8ef-573049a1c296", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.818229, - "longitude": 10.3649909 + "lon": 10.35724928, + "lat": 58.8216045 }, "sog": 15.9, - "cog": 112.53, - "heading": 112.53, + "cog": 101.3, + "heading": 101.3, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.818229, - "longitude": 10.3649909 + "lon": 10.35724928, + "lat": 58.8216045 } }, { "position": { - "latitude": 58.80130577, - "longitude": 10.44352233 + "lon": 10.60736457, + "lat": 58.79564283 } } - ] - }, - { + ], "static": { - "id": "29d13c09-719c-463f-81d1-306de57352af", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.7729381, - "longitude": 10.5034415 + "lon": 10.5034415, + "lat": 58.7729381 }, "sog": 7.0, "cog": 339.99, @@ -131,17 +138,31 @@ "waypoints": [ { "position": { - "latitude": 58.7729381, - "longitude": 10.5034415 + "lon": 10.5034415, + "lat": 58.7729381 } }, { "position": { - "latitude": 58.79115902, - "longitude": 10.49067118 + "lon": 10.46513053, + "lat": 58.82760088 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_43.json b/data/baseline_situations_generated/traffic_situation_43.json index af321b4..16914c8 100644 --- a/data/baseline_situations_generated/traffic_situation_43.json +++ b/data/baseline_situations_generated/traffic_situation_43.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, OT-GW, OT-GW", "description": "Crossing give way, overtaking stand-on and overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { + "initial": { + "position": { + "lon": 10.57321977, + "lat": 58.85544026 + }, + "sog": 12.1, + "cog": 225.52, + "heading": 225.52, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.57321977, + "lat": 58.85544026 + } + }, + { + "position": { + "lon": 10.43563173, + "lat": 58.78523803 + } + } + ], "static": { - "id": "e5780700-ac63-4233-a076-22872a892cfd", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, + "id": 10, "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" + } + }, + { + "initial": { + "position": { + "lon": 10.50534234, + "lat": 58.79191629 + }, + "sog": 5.1, + "cog": 344.18, + "heading": 344.18, + "navStatus": "Under way using engine" }, + "waypoints": [ + { + "position": { + "lon": 10.50534234, + "lat": 58.79191629 + } + }, + { + "position": { + "lon": 10.48328948, + "lat": 58.83233822 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { "initial": { "position": { - "latitude": 58.83964904, - "longitude": 10.55904984 + "lon": 10.47102346, + "lat": 58.78532689 }, - "sog": 12.1, - "cog": 216.23, - "heading": 216.23, + "sog": 7.0, + "cog": 12.15, + "heading": 12.15, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83964904, - "longitude": 10.55904984 + "lon": 10.47102346, + "lat": 58.78532689 } }, { "position": { - "latitude": 58.8127117, - "longitude": 10.52105285 + "lon": 10.49458517, + "lat": 58.84219795 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_44.json b/data/baseline_situations_generated/traffic_situation_44.json index 6feac13..5b9fe8d 100644 --- a/data/baseline_situations_generated/traffic_situation_44.json +++ b/data/baseline_situations_generated/traffic_situation_44.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, OT-GW, OT-SO", "description": "Crossing give way, overtaking give-way and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "4aaa9de2-6ec0-4541-8fa9-612a4db5c754", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.81472782, - "longitude": 10.70233895 + "lon": 10.69941856, + "lat": 58.81401861 }, "sog": 14.0, - "cog": 257.89, - "heading": 257.89, + "cog": 285.33, + "heading": 285.33, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81472782, - "longitude": 10.70233895 + "lon": 10.69941856, + "lat": 58.81401861 } }, { "position": { - "latitude": 58.80659059, - "longitude": 10.62934931 + "lon": 10.48343609, + "lat": 58.84478401 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } }, { + "initial": { + "position": { + "lon": 10.51135592, + "lat": 58.79300255 + }, + "sog": 5.1, + "cog": 337.41, + "heading": 337.41, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.51135592, + "lat": 58.79300255 + } + }, + { + "position": { + "lon": 10.48029643, + "lat": 58.83179463 + } + } + ], "static": { - "id": "ea1fe2b6-9c64-4dbb-8d79-16b56ebc51b4", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49452481, + "lat": 58.74043996 }, "sog": 15.9, - "cog": 357.24, - "heading": 357.24, + "cog": 358.16, + "heading": 358.16, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7293888, - "longitude": 10.49639109 + "lon": 10.49452481, + "lat": 58.74043996 } }, { "position": { - "latitude": 58.77350627, - "longitude": 10.49229598 + "lon": 10.48631708, + "lat": 58.87287753 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_45.json b/data/baseline_situations_generated/traffic_situation_45.json index 0d7fe81..04b0d07 100644 --- a/data/baseline_situations_generated/traffic_situation_45.json +++ b/data/baseline_situations_generated/traffic_situation_45.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-GW, OT-SO, OT-SO", "description": "Crossing give way and two overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "25b22987-1a9c-4a75-a0d5-af47fb364d35", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.83655184, - "longitude": 10.55626769 + "lon": 10.56864046, + "lat": 58.85032315 }, "sog": 12.1, - "cog": 216.92, - "heading": 216.92, + "cog": 225.52, + "heading": 225.52, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83655184, - "longitude": 10.55626769 + "lon": 10.56864046, + "lat": 58.85032315 } }, { "position": { - "latitude": 58.80985331, - "longitude": 10.51765124 + "lon": 10.43105242, + "lat": 58.78012092 } } - ] - }, - { + ], "static": { - "id": "074bd7ee-78e6-4b82-a608-50d977d98103", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.71893913, - "longitude": 10.53060629 + "lon": 10.5085565, + "lat": 58.74350125 }, - "sog": 18.1, - "cog": 343.95, - "heading": 343.95, + "sog": 15.0, + "cog": 351.4, + "heading": 351.4, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71893913, - "longitude": 10.53060629 + "lon": 10.5085565, + "lat": 58.74350125 } }, { "position": { - "latitude": 58.76707949, - "longitude": 10.50394162 + "lon": 10.47272123, + "lat": 58.86652718 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "70961523-ef61-481d-92be-c92d838ce207", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.70876775, - "longitude": 10.47209485 + "lon": 10.48135714, + "lat": 58.73605002 }, "sog": 15.0, - "cog": 6.65, - "heading": 6.65, + "cog": 3.32, + "heading": 3.32, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70876775, - "longitude": 10.47209485 + "lon": 10.48135714, + "lat": 58.73605002 } }, { "position": { - "latitude": 58.74996453, - "longitude": 10.48133501 + "lon": 10.49524073, + "lat": 58.86026734 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_46.json b/data/baseline_situations_generated/traffic_situation_46.json index 1e72d42..185e305 100644 --- a/data/baseline_situations_generated/traffic_situation_46.json +++ b/data/baseline_situations_generated/traffic_situation_46.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, CR-SO, CR-SO", "description": "Two crossing stand-on and one crossing stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "3bb6aa8d-dc26-4d2d-8c61-827f5ff5710e", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.82287031, - "longitude": 10.47048777 + "lon": 10.4617266, + "lat": 58.84868926 }, "sog": 6.0, - "cog": 161.75, - "heading": 161.75, + "cog": 153.27, + "heading": 153.27, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.82287031, - "longitude": 10.47048777 + "lon": 10.4617266, + "lat": 58.84868926 } }, { "position": { - "latitude": 58.80701266, - "longitude": 10.48055548 + "lon": 10.50510283, + "lat": 58.80395017 } } - ] - }, - { + ], "static": { - "id": "570237ed-04ce-4df7-b172-233c2857a272", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.7798417, - "longitude": 10.37290533 + "lon": 10.38228859, + "lat": 58.77853101 }, "sog": 15.0, - "cog": 79.53, - "heading": 79.53, + "cog": 64.8, + "heading": 64.8, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7798417, - "longitude": 10.37290533 + "lon": 10.38228859, + "lat": 58.77853101 } }, { "position": { - "latitude": 58.78738112, - "longitude": 10.45141067 + "lon": 10.59900317, + "lat": 58.83150625 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "9f1111dd-e8ca-4754-ac17-cabdddf5286f", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.86039577, - "longitude": 10.38291068 + "lon": 10.3649045, + "lat": 58.87659098 }, "sog": 16.9, - "cog": 141.06, - "heading": 141.06, + "cog": 132.81, + "heading": 132.81, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.86039577, - "longitude": 10.38291068 + "lon": 10.3649045, + "lat": 58.87659098 } }, { "position": { - "latitude": 58.8239452, - "longitude": 10.43960157 + "lon": 10.56342268, + "lat": 58.78105024 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_47.json b/data/baseline_situations_generated/traffic_situation_47.json index 87b7c37..3db0a44 100644 --- a/data/baseline_situations_generated/traffic_situation_47.json +++ b/data/baseline_situations_generated/traffic_situation_47.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, CR-SO, OT-SO", "description": "Two crossing stand-on situations and one overtaking stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "cdfa9a22-bd10-438e-9d67-a90abb9dda39", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.8721741, - "longitude": 10.41448198 + "lon": 10.41194176, + "lat": 58.87578301 }, - "sog": 18.1, - "cog": 153.95, - "heading": 153.95, + "sog": 15.0, + "cog": 146.79, + "heading": 146.79, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.8721741, - "longitude": 10.41448198 + "lon": 10.41194176, + "lat": 58.87578301 } }, { "position": { - "latitude": 58.82716783, - "longitude": 10.4568217 + "lon": 10.54311538, + "lat": 58.77167708 } } - ] - }, - { + ], "static": { - "id": "31e9db13-0494-4437-8fca-eff4ed5ba1a4", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.81237574, - "longitude": 10.37841778 + "lon": 10.37205859, + "lat": 58.81514976 }, "sog": 14.0, - "cog": 110.01, - "heading": 110.01, + "cog": 96.83, + "heading": 96.83, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.81237574, - "longitude": 10.37841778 + "lon": 10.37205859, + "lat": 58.81514976 } }, { "position": { - "latitude": 58.79910639, - "longitude": 10.44856358 + "lon": 10.59442337, + "lat": 58.8013136 } } - ] - }, - { + ], "static": { - "id": "ffd3df9f-82a1-444a-a784-48895f9093f6", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.67733793, - "longitude": 10.44624336 + "lon": 10.4752226, + "lat": 58.73350942 }, - "sog": 19.1, - "cog": 11.46, - "heading": 11.46, + "sog": 15.0, + "cog": 5.04, + "heading": 5.04, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.67733793, - "longitude": 10.44624336 + "lon": 10.4752226, + "lat": 58.73350942 } }, { "position": { - "latitude": 58.72907272, - "longitude": 10.46642991 + "lon": 10.49627197, + "lat": 58.8574545 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_48.json b/data/baseline_situations_generated/traffic_situation_48.json index 24286d5..a9a562a 100644 --- a/data/baseline_situations_generated/traffic_situation_48.json +++ b/data/baseline_situations_generated/traffic_situation_48.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, CR-SO, OT-GW", "description": "Two crossing stand-on situations and one overtaking give-way situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "502a1289-c97f-443e-99cb-4c40b4513f85", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.80948503, - "longitude": 10.40204009 + "lon": 10.39602651, + "lat": 58.81260916 }, "sog": 8.9, - "cog": 111.73, - "heading": 111.73, + "cog": 82.74, + "heading": 82.74, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80948503, - "longitude": 10.40204009 + "lon": 10.39602651, + "lat": 58.81260916 } }, { "position": { - "latitude": 58.80031284, - "longitude": 10.44634581 + "lon": 10.53795961, + "lat": 58.82200904 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { + "initial": { + "position": { + "lon": 10.35479546, + "lat": 58.80419735 + }, + "sog": 15.9, + "cog": 87.09, + "heading": 87.09, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.35479546, + "lat": 58.80419735 + } + }, + { + "position": { + "lon": 10.60952524, + "lat": 58.81092528 + } + } + ], "static": { - "id": "3331dd8b-ee9c-4b22-a41e-3eee6feeb9ec", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, + "id": 10, "name": "target_ship_2", - "shipType": "Cargo" - }, + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { "initial": { "position": { - "latitude": 58.80361382, - "longitude": 10.35674815 + "lon": 10.5136715, + "lat": 58.78053296 }, - "sog": 15.9, - "cog": 100.15, - "heading": 100.15, + "sog": 7.0, + "cog": 339.94, + "heading": 339.94, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.80361382, - "longitude": 10.35674815 + "lon": 10.5136715, + "lat": 58.78053296 } }, { "position": { - "latitude": 58.79582785, - "longitude": 10.44043637 + "lon": 10.47525533, + "lat": 58.83517582 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_49.json b/data/baseline_situations_generated/traffic_situation_49.json index 618a9a8..e09a73d 100644 --- a/data/baseline_situations_generated/traffic_situation_49.json +++ b/data/baseline_situations_generated/traffic_situation_49.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, OT-GW, OT-GW", "description": "One crossing stand-on situation and two overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { + "initial": { + "position": { + "lon": 10.3997418, + "lat": 58.86473185 + }, + "sog": 14.0, + "cog": 137.45, + "heading": 137.45, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.3997418, + "lat": 58.86473185 + } + }, + { + "position": { + "lon": 10.55117957, + "lat": 58.77901701 + } + } + ], "static": { - "id": "cd3fcce3-90d1-42d4-a80b-c73345fabadd", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, + "id": 10, "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, "shipType": "Passenger" + } + }, + { + "initial": { + "position": { + "lon": 10.50230099, + "lat": 58.78601814 + }, + "sog": 6.0, + "cog": 349.56, + "heading": 349.56, + "navStatus": "Under way using engine" }, + "waypoints": [ + { + "position": { + "lon": 10.50230099, + "lat": 58.78601814 + } + }, + { + "position": { + "lon": 10.48483086, + "lat": 58.8352829 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } + }, + { "initial": { "position": { - "latitude": 58.84858154, - "longitude": 10.41424005 + "lon": 10.47102346, + "lat": 58.78532689 }, - "sog": 14.0, - "cog": 145.36, - "heading": 145.36, + "sog": 7.0, + "cog": 12.15, + "heading": 12.15, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.84858154, - "longitude": 10.41424005 + "lon": 10.47102346, + "lat": 58.78532689 } }, { "position": { - "latitude": 58.81667403, - "longitude": 10.45667389 + "lon": 10.49458517, + "lat": 58.84219795 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_50.json b/data/baseline_situations_generated/traffic_situation_50.json index 7eba51c..27b2a38 100644 --- a/data/baseline_situations_generated/traffic_situation_50.json +++ b/data/baseline_situations_generated/traffic_situation_50.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, OT-GW, OT-SO", "description": "Crossing stand-on, overtaking give-way situation and overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "c683531e-652a-4af2-a0c7-5f6471adf0ab", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.79416063, - "longitude": 10.36388496 + "lon": 10.36827418, + "lat": 58.79309232 }, "sog": 14.0, - "cog": 92.59, - "heading": 92.59, + "cog": 74.66, + "heading": 74.66, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.79416063, - "longitude": 10.36388496 + "lon": 10.36827418, + "lat": 58.79309232 } }, { "position": { - "latitude": 58.79240813, - "longitude": 10.43846004 + "lon": 10.58424567, + "lat": 58.82387852 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { + "initial": { + "position": { + "lon": 10.51310124, + "lat": 58.8069534 + }, + "sog": 4.1, + "cog": 335.64, + "heading": 335.64, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.51310124, + "lat": 58.8069534 + } + }, + { + "position": { + "lon": 10.48615745, + "lat": 58.83786647 + } + } + ], "static": { - "id": "365e58d2-499f-4071-970c-ea5d21f3ac3b", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, "shipType": "Cargo" - }, + } + }, + { "initial": { "position": { - "latitude": 58.70297734, - "longitude": 10.50083216 + "lon": 10.49618373, + "lat": 58.73057382 }, "sog": 15.9, - "cog": 356.55, - "heading": 356.55, + "cog": 358.16, + "heading": 358.16, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70297734, - "longitude": 10.50083216 + "lon": 10.49618373, + "lat": 58.73057382 } }, { "position": { - "latitude": 58.7470661, - "longitude": 10.49571832 + "lon": 10.487976, + "lat": 58.86301139 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_51.json b/data/baseline_situations_generated/traffic_situation_51.json index 815c5a9..c02042d 100644 --- a/data/baseline_situations_generated/traffic_situation_51.json +++ b/data/baseline_situations_generated/traffic_situation_51.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "CR-SO, OT-SO, OT-SO", "description": "One crossing stand-on situation and two overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "db9e7d6c-5fbf-44d9-8fa7-c84757bb3e60", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_1", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.83744958, - "longitude": 10.42422813 + "lon": 10.41353156, + "lat": 58.84936257 }, "sog": 13.0, - "cog": 143.3, - "heading": 143.3, + "cog": 136.08, + "heading": 136.08, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.83744958, - "longitude": 10.42422813 + "lon": 10.41353156, + "lat": 58.84936257 } }, { "position": { - "latitude": 58.80851546, - "longitude": 10.46574665 + "lon": 10.55809668, + "lat": 58.77138 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "586a4d94-8d3c-44cd-b073-0311b9c55fa0", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.73740561, - "longitude": 10.51403439 + "lon": 10.51177065, + "lat": 58.73992825 }, "sog": 18.1, - "cog": 347.27, - "heading": 347.27, + "cog": 348.53, + "heading": 348.53, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.73740561, - "longitude": 10.51403439 + "lon": 10.51177065, + "lat": 58.73992825 } }, { "position": { - "latitude": 58.78626802, - "longitude": 10.49278608 + "lon": 10.45424825, + "lat": 58.88720851 } } - ] - }, - { + ], "static": { - "id": "fae8ac8b-ee70-42d4-9227-930e0a061fe9", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.70538328, - "longitude": 10.44997593 + "lon": 10.46813763, + "lat": 58.73130099 }, "sog": 15.9, - "cog": 13.87, - "heading": 13.87, + "cog": 7.62, + "heading": 7.62, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70538328, - "longitude": 10.44997593 + "lon": 10.46813763, + "lat": 58.73130099 } }, { "position": { - "latitude": 58.74826496, - "longitude": 10.47035043 + "lon": 10.50196053, + "lat": 58.86263696 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_52.json b/data/baseline_situations_generated/traffic_situation_52.json index 94ffda9..cae4fc7 100644 --- a/data/baseline_situations_generated/traffic_situation_52.json +++ b/data/baseline_situations_generated/traffic_situation_52.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW, OT-GW, OT-GW", "description": "Three overtaking give-way situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,17 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, - "targetShips": [] + "targetShips": [ + { + "initial": { + "position": { + "lon": 10.4828087, + "lat": 58.77865669 + }, + "sog": 7.0, + "cog": 6.7, + "heading": 6.7, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.4828087, + "lat": 58.77865669 + } + }, + { + "position": { + "lon": 10.49588014, + "lat": 58.83643243 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } + }, + { + "initial": { + "position": { + "lon": 10.50230099, + "lat": 58.78601814 + }, + "sog": 6.0, + "cog": 349.56, + "heading": 349.56, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.50230099, + "lat": 58.78601814 + } + }, + { + "position": { + "lon": 10.48483086, + "lat": 58.8352829 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { + "initial": { + "position": { + "lon": 10.45804588, + "lat": 58.79978047 + }, + "sog": 5.1, + "cog": 31.74, + "heading": 31.74, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.45804588, + "lat": 58.79978047 + } + }, + { + "position": { + "lon": 10.50059223, + "lat": 58.83551045 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + } + ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_53.json b/data/baseline_situations_generated/traffic_situation_53.json index 179506e..d3c1cda 100644 --- a/data/baseline_situations_generated/traffic_situation_53.json +++ b/data/baseline_situations_generated/traffic_situation_53.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW, OT-GW, OT-SO", "description": "Two overtaking give-way situations and one overtaking stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,53 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { + "initial": { + "position": { + "lon": 10.490654, + "lat": 58.77758838 + }, + "sog": 7.0, + "cog": 0.0, + "heading": 0.0, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.490654, + "lat": 58.77758838 + } + }, + { + "position": { + "lon": 10.490654, + "lat": 58.83576183 + } + } + ], "static": { - "id": "2db3c199-dc28-4f00-b1ce-7ecaed62f27e", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", - "shipType": "Passenger" + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } + }, + { + "initial": { + "position": { + "lon": 10.50774432, + "lat": 58.8138211 + }, + "sog": 4.1, + "cog": 344.81, + "heading": 344.81, + "navStatus": "Under way using engine" }, + "waypoints": [ + { + "position": { + "lon": 10.50774432, + "lat": 58.8138211 + } + }, + { + "position": { + "lon": 10.49062474, + "lat": 58.8465694 + } + } + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } + }, + { "initial": { "position": { - "latitude": 58.69760886, - "longitude": 10.47955998 + "lon": 10.48420841, + "lat": 58.72519637 }, "sog": 16.9, - "cog": 3.55, - "heading": 3.55, + "cog": 2.06, + "heading": 2.06, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.69760886, - "longitude": 10.47955998 + "lon": 10.48420841, + "lat": 58.72519637 } }, { "position": { - "latitude": 58.74438077, - "longitude": 10.48514903 + "lon": 10.49394831, + "lat": 58.86569111 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_54.json b/data/baseline_situations_generated/traffic_situation_54.json index 17f26e2..0e877bb 100644 --- a/data/baseline_situations_generated/traffic_situation_54.json +++ b/data/baseline_situations_generated/traffic_situation_54.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-GW, OT-SO, OT-SO", "description": "One overtaking give-way situation and two overtaking stand-on situations with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,88 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] - }, - "targetShips": [ - { - "static": { - "id": "a6261754-ef85-4613-9662-76319cc0e66c", + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { "length": 122.0, "width": 20.0, "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_2", - "shipType": "Passenger" + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 }, + "shipType": "Passenger" + } + }, + "targetShips": [ + { "initial": { "position": { - "latitude": 58.71434271, - "longitude": 10.53471903 + "lon": 10.47057417, + "lat": 58.7815115 }, - "sog": 18.1, - "cog": 343.43, - "heading": 343.43, + "sog": 7.0, + "cog": 15.58, + "heading": 15.58, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.71434271, - "longitude": 10.53471903 + "lon": 10.47057417, + "lat": 58.7815115 } }, { "position": { - "latitude": 58.76235644, - "longitude": 10.50722147 + "lon": 10.50065774, + "lat": 58.83754623 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } }, { + "initial": { + "position": { + "lon": 10.52136128, + "lat": 58.72923619 + }, + "sog": 18.1, + "cog": 348.53, + "heading": 348.53, + "navStatus": "Under way using engine" + }, + "waypoints": [ + { + "position": { + "lon": 10.52136128, + "lat": 58.72923619 + } + }, + { + "position": { + "lon": 10.46383888, + "lat": 58.87651644 + } + } + ], "static": { - "id": "7c640290-36c5-4af7-9df1-0dada3165355", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, "shipType": "Passenger" - }, + } + }, + { "initial": { "position": { - "latitude": 58.70365064, - "longitude": 10.4487663 + "lon": 10.47366736, + "lat": 58.73919211 }, - "sog": 18.1, - "cog": 13.98, - "heading": 13.98, + "sog": 15.0, + "cog": 6.76, + "heading": 6.76, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70365064, - "longitude": 10.4487663 + "lon": 10.47366736, + "lat": 58.73919211 } }, { "position": { - "latitude": 58.75226064, - "longitude": 10.47206115 + "lon": 10.50186358, + "lat": 58.8627534 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_generated/traffic_situation_55.json b/data/baseline_situations_generated/traffic_situation_55.json index 1cf8c59..ccf96e8 100644 --- a/data/baseline_situations_generated/traffic_situation_55.json +++ b/data/baseline_situations_generated/traffic_situation_55.json @@ -1,21 +1,12 @@ { + "version": "0.6.0", "title": "OT-SO, OT-SO, OT-SO", "description": "Three overtaking stand-on situation with three target ships.", "ownShip": { - "static": { - "id": "27b8e920-d131-49d1-be47-284c99a128d9", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "mmsi": 257847600, - "name": "BASTO VI", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 }, "sog": 10.0, "cog": 0.0, @@ -25,123 +16,153 @@ "waypoints": [ { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.763449 } }, { "position": { - "latitude": 58.7911568, - "longitude": 10.490654 + "lon": 10.490654, + "lat": 58.8465724 } } - ] + ], + "static": { + "id": 0, + "mmsi": 257847600, + "name": "BASTO VI", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, "targetShips": [ { - "static": { - "id": "5f8224e3-e17f-4512-84d3-507031fa4827", - "length": 178.0, - "width": 30.0, - "height": 30.0, - "speedMax": 21.0, - "name": "target_ship_1", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.70727751, - "longitude": 10.50971429 + "lon": 10.50098768, + "lat": 58.73299771 }, - "sog": 19.1, - "cog": 353.29, - "heading": 353.29, + "sog": 16.9, + "cog": 355.92, + "heading": 355.92, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70727751, - "longitude": 10.50971429 + "lon": 10.50098768, + "lat": 58.73299771 } }, { "position": { - "latitude": 58.75970249, - "longitude": 10.49783446 + "lon": 10.48174041, + "lat": 58.8732275 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_1", + "dimensions": { + "length": 122.0, + "width": 20.0, + "height": 8.0, + "a": 61.0, + "b": 61.0, + "c": 10.0, + "d": 10.0 + }, + "shipType": "Passenger" + } }, { - "static": { - "id": "ea1f5e8c-7471-4d99-a22e-99507c7565ef", - "length": 50.0, - "width": 10.0, - "height": 8.0, - "speedMax": 15.0, - "name": "target_ship_2", - "shipType": "Cargo" - }, "initial": { "position": { - "latitude": 58.70976424, - "longitude": 10.53884905 + "lon": 10.51095847, + "lat": 58.74083497 }, - "sog": 18.1, - "cog": 342.92, - "heading": 342.92, + "sog": 15.0, + "cog": 351.4, + "heading": 351.4, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.70976424, - "longitude": 10.53884905 + "lon": 10.51095847, + "lat": 58.74083497 } }, { "position": { - "latitude": 58.75764747, - "longitude": 10.51052083 + "lon": 10.4751232, + "lat": 58.86386089 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_2", + "dimensions": { + "length": 50.0, + "width": 10.0, + "height": 8.0, + "a": 25.0, + "b": 25.0, + "c": 5.0, + "d": 5.0 + }, + "shipType": "Cargo" + } }, { - "static": { - "id": "9f9f3674-bd0f-4213-963d-5d944f35eec2", - "length": 122.0, - "width": 20.0, - "height": 8.0, - "speedMax": 17.0, - "name": "target_ship_3", - "shipType": "Passenger" - }, "initial": { "position": { - "latitude": 58.7002931, - "longitude": 10.44641617 + "lon": 10.46450875, + "lat": 58.72613001 }, "sog": 16.9, - "cog": 14.21, - "heading": 14.21, + "cog": 8.31, + "heading": 8.31, "navStatus": "Under way using engine" }, "waypoints": [ { "position": { - "latitude": 58.7002931, - "longitude": 10.44641617 + "lon": 10.46450875, + "lat": 58.72613001 } }, { "position": { - "latitude": 58.74572132, - "longitude": 10.46855808 + "lon": 10.50361001, + "lat": 58.86524053 } } - ] + ], + "static": { + "id": 10, + "name": "target_ship_3", + "dimensions": { + "length": 178.0, + "width": 30.0, + "height": 30.0, + "a": 89.0, + "b": 89.0, + "c": 15.0, + "d": 15.0 + }, + "shipType": "Passenger" + } } ] } \ No newline at end of file diff --git a/data/baseline_situations_input/baseline_situation_01_1_ts.json b/data/baseline_situations_input/baseline_situation_01_1_ts.json index aedb77f..ce339cd 100644 --- a/data/baseline_situations_input/baseline_situation_01_1_ts.json +++ b/data/baseline_situations_input/baseline_situation_01_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_02_1_ts.json b/data/baseline_situations_input/baseline_situation_02_1_ts.json index 20f061b..00fb1f5 100644 --- a/data/baseline_situations_input/baseline_situation_02_1_ts.json +++ b/data/baseline_situations_input/baseline_situation_02_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_03_1_ts.json b/data/baseline_situations_input/baseline_situation_03_1_ts.json index c8863de..5d4fd1b 100644 --- a/data/baseline_situations_input/baseline_situation_03_1_ts.json +++ b/data/baseline_situations_input/baseline_situation_03_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_04_1_ts.json b/data/baseline_situations_input/baseline_situation_04_1_ts.json index 987ea46..6cd8700 100644 --- a/data/baseline_situations_input/baseline_situation_04_1_ts.json +++ b/data/baseline_situations_input/baseline_situation_04_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_05_1_ts.json b/data/baseline_situations_input/baseline_situation_05_1_ts.json index d85a6f1..2d594bc 100644 --- a/data/baseline_situations_input/baseline_situation_05_1_ts.json +++ b/data/baseline_situations_input/baseline_situation_05_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_06_2_ts.json b/data/baseline_situations_input/baseline_situation_06_2_ts.json index d35546e..caeb0fb 100644 --- a/data/baseline_situations_input/baseline_situation_06_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_06_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_07_2_ts.json b/data/baseline_situations_input/baseline_situation_07_2_ts.json index a0383d4..e7e2bf0 100644 --- a/data/baseline_situations_input/baseline_situation_07_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_07_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_08_2_ts.json b/data/baseline_situations_input/baseline_situation_08_2_ts.json index a2b29b0..60c0082 100644 --- a/data/baseline_situations_input/baseline_situation_08_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_08_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_09_2_ts.json b/data/baseline_situations_input/baseline_situation_09_2_ts.json index d73b69c..e545d0b 100644 --- a/data/baseline_situations_input/baseline_situation_09_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_09_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_10_2_ts.json b/data/baseline_situations_input/baseline_situation_10_2_ts.json index efb22c7..1c229a3 100644 --- a/data/baseline_situations_input/baseline_situation_10_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_10_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_11_2_ts.json b/data/baseline_situations_input/baseline_situation_11_2_ts.json index c3a73f3..5ad0bb4 100644 --- a/data/baseline_situations_input/baseline_situation_11_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_11_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_12_2_ts.json b/data/baseline_situations_input/baseline_situation_12_2_ts.json index e7150df..36fe6c8 100644 --- a/data/baseline_situations_input/baseline_situation_12_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_12_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_13_2_ts.json b/data/baseline_situations_input/baseline_situation_13_2_ts.json index 14eca11..3088432 100644 --- a/data/baseline_situations_input/baseline_situation_13_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_13_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_14_2_ts.json b/data/baseline_situations_input/baseline_situation_14_2_ts.json index 6c11eb7..343c883 100644 --- a/data/baseline_situations_input/baseline_situation_14_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_14_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_15_2_ts.json b/data/baseline_situations_input/baseline_situation_15_2_ts.json index ac07975..eae255a 100644 --- a/data/baseline_situations_input/baseline_situation_15_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_15_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_16_2_ts.json b/data/baseline_situations_input/baseline_situation_16_2_ts.json index 786fb31..15aca52 100644 --- a/data/baseline_situations_input/baseline_situation_16_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_16_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_17_2_ts.json b/data/baseline_situations_input/baseline_situation_17_2_ts.json index 077438c..702b712 100644 --- a/data/baseline_situations_input/baseline_situation_17_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_17_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_18_2_ts.json b/data/baseline_situations_input/baseline_situation_18_2_ts.json index ea4c3e1..81c0cbb 100644 --- a/data/baseline_situations_input/baseline_situation_18_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_18_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_19_2_ts.json b/data/baseline_situations_input/baseline_situation_19_2_ts.json index 2c11539..19f94d7 100644 --- a/data/baseline_situations_input/baseline_situation_19_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_19_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_20_2_ts.json b/data/baseline_situations_input/baseline_situation_20_2_ts.json index f908edc..1b71cf3 100644 --- a/data/baseline_situations_input/baseline_situation_20_2_ts.json +++ b/data/baseline_situations_input/baseline_situation_20_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_21_3_ts.json b/data/baseline_situations_input/baseline_situation_21_3_ts.json index 0d0cd7b..180ae8d 100644 --- a/data/baseline_situations_input/baseline_situation_21_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_21_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_22_3_ts.json b/data/baseline_situations_input/baseline_situation_22_3_ts.json index 5377893..1b34fd6 100644 --- a/data/baseline_situations_input/baseline_situation_22_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_22_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_23_3_ts.json b/data/baseline_situations_input/baseline_situation_23_3_ts.json index 54c9b93..59050ef 100644 --- a/data/baseline_situations_input/baseline_situation_23_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_23_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_24_3_ts.json b/data/baseline_situations_input/baseline_situation_24_3_ts.json index 35f041e..40d7dd0 100644 --- a/data/baseline_situations_input/baseline_situation_24_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_24_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_25_3_ts.json b/data/baseline_situations_input/baseline_situation_25_3_ts.json index d921884..e23478e 100644 --- a/data/baseline_situations_input/baseline_situation_25_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_25_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_26_3_ts.json b/data/baseline_situations_input/baseline_situation_26_3_ts.json index 99dec7e..47e40af 100644 --- a/data/baseline_situations_input/baseline_situation_26_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_26_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_27_3_ts.json b/data/baseline_situations_input/baseline_situation_27_3_ts.json index c88b8ab..71876d5 100644 --- a/data/baseline_situations_input/baseline_situation_27_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_27_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_28_3_ts.json b/data/baseline_situations_input/baseline_situation_28_3_ts.json index d3dd2ac..26f51f3 100644 --- a/data/baseline_situations_input/baseline_situation_28_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_28_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_29_3_ts.json b/data/baseline_situations_input/baseline_situation_29_3_ts.json index 569ff81..e985255 100644 --- a/data/baseline_situations_input/baseline_situation_29_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_29_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_30_3_ts.json b/data/baseline_situations_input/baseline_situation_30_3_ts.json index 7ad7abd..ce640df 100644 --- a/data/baseline_situations_input/baseline_situation_30_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_30_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_31_3_ts.json b/data/baseline_situations_input/baseline_situation_31_3_ts.json index 3f62120..3f72548 100644 --- a/data/baseline_situations_input/baseline_situation_31_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_31_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_32_3_ts.json b/data/baseline_situations_input/baseline_situation_32_3_ts.json index d594ab9..8010f5a 100644 --- a/data/baseline_situations_input/baseline_situation_32_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_32_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_33_3_ts.json b/data/baseline_situations_input/baseline_situation_33_3_ts.json index a6d171f..cc67ade 100644 --- a/data/baseline_situations_input/baseline_situation_33_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_33_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_34_3_ts.json b/data/baseline_situations_input/baseline_situation_34_3_ts.json index 07f8487..1161b17 100644 --- a/data/baseline_situations_input/baseline_situation_34_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_34_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_35_3_ts.json b/data/baseline_situations_input/baseline_situation_35_3_ts.json index cd25e45..435e635 100644 --- a/data/baseline_situations_input/baseline_situation_35_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_35_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_36_3_ts.json b/data/baseline_situations_input/baseline_situation_36_3_ts.json index 771f5c0..d3637cf 100644 --- a/data/baseline_situations_input/baseline_situation_36_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_36_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_37_3_ts.json b/data/baseline_situations_input/baseline_situation_37_3_ts.json index 39c340a..6fe9e25 100644 --- a/data/baseline_situations_input/baseline_situation_37_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_37_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_38_3_ts.json b/data/baseline_situations_input/baseline_situation_38_3_ts.json index 99be6e2..7c8e83b 100644 --- a/data/baseline_situations_input/baseline_situation_38_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_38_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_39_3_ts.json b/data/baseline_situations_input/baseline_situation_39_3_ts.json index d43828b..3de4172 100644 --- a/data/baseline_situations_input/baseline_situation_39_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_39_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_40_3_ts.json b/data/baseline_situations_input/baseline_situation_40_3_ts.json index fe392d7..7ca23ae 100644 --- a/data/baseline_situations_input/baseline_situation_40_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_40_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_41_3_ts.json b/data/baseline_situations_input/baseline_situation_41_3_ts.json index c2a8ad0..0d2b41e 100644 --- a/data/baseline_situations_input/baseline_situation_41_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_41_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_42_3_ts.json b/data/baseline_situations_input/baseline_situation_42_3_ts.json index af10dea..0fc4234 100644 --- a/data/baseline_situations_input/baseline_situation_42_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_42_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_43_3_ts.json b/data/baseline_situations_input/baseline_situation_43_3_ts.json index f244b21..de9b4c6 100644 --- a/data/baseline_situations_input/baseline_situation_43_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_43_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_44_3_ts.json b/data/baseline_situations_input/baseline_situation_44_3_ts.json index 2c35e46..d2f6780 100644 --- a/data/baseline_situations_input/baseline_situation_44_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_44_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_45_3_ts.json b/data/baseline_situations_input/baseline_situation_45_3_ts.json index eb3914b..9b48094 100644 --- a/data/baseline_situations_input/baseline_situation_45_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_45_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_46_3_ts.json b/data/baseline_situations_input/baseline_situation_46_3_ts.json index db88394..d03f60e 100644 --- a/data/baseline_situations_input/baseline_situation_46_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_46_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_47_3_ts.json b/data/baseline_situations_input/baseline_situation_47_3_ts.json index 501dd01..9016279 100644 --- a/data/baseline_situations_input/baseline_situation_47_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_47_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_48_3_ts.json b/data/baseline_situations_input/baseline_situation_48_3_ts.json index c8538b9..beab07d 100644 --- a/data/baseline_situations_input/baseline_situation_48_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_48_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_49_3_ts.json b/data/baseline_situations_input/baseline_situation_49_3_ts.json index ce20887..6b3101b 100644 --- a/data/baseline_situations_input/baseline_situation_49_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_49_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_50_3_ts.json b/data/baseline_situations_input/baseline_situation_50_3_ts.json index 5c24d2a..a57b956 100644 --- a/data/baseline_situations_input/baseline_situation_50_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_50_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_51_3_ts.json b/data/baseline_situations_input/baseline_situation_51_3_ts.json index b6bf664..8e158cb 100644 --- a/data/baseline_situations_input/baseline_situation_51_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_51_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_52_3_ts.json b/data/baseline_situations_input/baseline_situation_52_3_ts.json index 2652ccb..10be327 100644 --- a/data/baseline_situations_input/baseline_situation_52_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_52_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_53_3_ts.json b/data/baseline_situations_input/baseline_situation_53_3_ts.json index 31c5cf2..89ea1e2 100644 --- a/data/baseline_situations_input/baseline_situation_53_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_53_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_54_3_ts.json b/data/baseline_situations_input/baseline_situation_54_3_ts.json index dabc18d..e96deac 100644 --- a/data/baseline_situations_input/baseline_situation_54_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_54_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/baseline_situations_input/baseline_situation_55_3_ts.json b/data/baseline_situations_input/baseline_situation_55_3_ts.json index 88eb0b0..56e4424 100644 --- a/data/baseline_situations_input/baseline_situation_55_3_ts.json +++ b/data/baseline_situations_input/baseline_situation_55_3_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, diff --git a/data/example_situations_input/example_several_situations_01_1_ts.json b/data/example_situations_input/example_several_situations_01_1_ts.json index 12056bc..5057f9a 100644 --- a/data/example_situations_input/example_several_situations_01_1_ts.json +++ b/data/example_situations_input/example_several_situations_01_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 7.0, "cog": 0.0, @@ -18,4 +18,4 @@ "desiredEncounterType": "overtaking-give-ay" } ] -} \ No newline at end of file +} diff --git a/data/example_situations_input/example_several_situations_02_2_ts.json b/data/example_situations_input/example_several_situations_02_2_ts.json index 11d1e89..71180d9 100644 --- a/data/example_situations_input/example_several_situations_02_2_ts.json +++ b/data/example_situations_input/example_several_situations_02_2_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 7.0, "cog": 0.0, @@ -21,4 +21,4 @@ "desiredEncounterType": "crossing-give-way" } ] -} \ No newline at end of file +} diff --git a/data/example_situations_input/example_situation_01_1_ts.json b/data/example_situations_input/example_situation_01_1_ts.json index fcf0e4e..4cd151b 100644 --- a/data/example_situations_input/example_situation_01_1_ts.json +++ b/data/example_situations_input/example_situation_01_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 270.0, @@ -19,4 +19,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/data/example_situations_input/example_situation_02_1_ts.json b/data/example_situations_input/example_situation_02_1_ts.json index c7c827e..5bd37d1 100644 --- a/data/example_situations_input/example_situation_02_1_ts.json +++ b/data/example_situations_input/example_situation_02_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, @@ -17,4 +17,4 @@ "desiredEncounterType": "crossing-give-way" } ] -} \ No newline at end of file +} diff --git a/data/example_situations_input/example_situation_03_1_ts.json b/data/example_situations_input/example_situation_03_1_ts.json index 35785f5..0f9c3d1 100644 --- a/data/example_situations_input/example_situation_03_1_ts.json +++ b/data/example_situations_input/example_situation_03_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, @@ -17,4 +17,4 @@ "desiredEncounterType": "crossing-stand-on" } ] -} \ No newline at end of file +} diff --git a/data/example_situations_input/example_situation_04_1_ts.json b/data/example_situations_input/example_situation_04_1_ts.json index 091ee0f..17dc69f 100644 --- a/data/example_situations_input/example_situation_04_1_ts.json +++ b/data/example_situations_input/example_situation_04_1_ts.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 7.0, "cog": 0.0, @@ -17,4 +17,4 @@ "desiredEncounterType": "overtaking-give-way" } ] -} \ No newline at end of file +} diff --git a/data/own_ship/own_ship.json b/data/own_ship/own_ship.json index cbab8f4..d2a120a 100644 --- a/data/own_ship/own_ship.json +++ b/data/own_ship/own_ship.json @@ -1,8 +1,10 @@ { - "length": 122, - "width": 20, - "height": 8, - "speedMax": 17, + "dimensions": { + "length": 122, + "width": 20, + "height": 8 + }, + "sogMax": 17, "mmsi": 257847600, "name": "BASTO VI", "shipType": "Passenger" diff --git a/data/target_ships/target_ship_1.json b/data/target_ships/target_ship_1.json index e4dc5bb..341b373 100644 --- a/data/target_ships/target_ship_1.json +++ b/data/target_ships/target_ship_1.json @@ -1,7 +1,9 @@ { - "length": 122, - "width": 20, - "height": 8, - "speedMax": 17, + "dimensions": { + "length": 122, + "width": 20, + "height": 8 + }, + "sogMax": 17, "shipType": "Passenger" } diff --git a/data/target_ships/target_ship_2.json b/data/target_ships/target_ship_2.json index d4ea8b3..fca848a 100644 --- a/data/target_ships/target_ship_2.json +++ b/data/target_ships/target_ship_2.json @@ -1,7 +1,9 @@ { - "length": 50, - "width": 10, - "height": 8, - "speedMax": 15, + "dimensions": { + "length": 50, + "width": 10, + "height": 8 + }, + "sogMax": 15, "shipType": "Cargo" } diff --git a/data/target_ships/target_ship_3.json b/data/target_ships/target_ship_3.json index 41d8619..106cc7b 100644 --- a/data/target_ships/target_ship_3.json +++ b/data/target_ships/target_ship_3.json @@ -1,7 +1,9 @@ { - "length": 178, - "width": 30, - "height": 30, - "speedMax": 21, + "dimensions": { + "length": 178, + "width": 30, + "height": 30 + }, + "sogMax": 21, "shipType": "Passenger" } diff --git a/docs/authors.rst b/docs/authors.rst deleted file mode 100644 index e122f91..0000000 --- a/docs/authors.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../AUTHORS.rst diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index a671795..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python -# -# trafficgen documentation build configuration file, created by -# sphinx-quickstart on Fri Jun 9 13:47:02 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another -# directory, add these directories to sys.path here. If the directory is -# relative to the documentation root, use os.path.abspath to make it -# absolute, like shown here. -# -import os -import sys - -try: - import tomli as tomli # pyright: ignore -except ImportError: - # for Python >= 3.11 - import tomllib as tomli # pyright: ignore - -with open("../pyproject.toml", "rb") as f: - toml = tomli.load(f) -pyproject = toml["tool"]["poetry"] - -sys.path.insert(0, os.path.abspath("..")) -sys.path.insert(0, os.path.abspath("../src")) - - -# -- General configuration --------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["sphinx.ext.viewcode", "sphinx.ext.napoleon"] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = ".rst" - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = "Traffic Generator" -copyright = "2024, DNV, Tom Arne Pedersen" -author = "Tom Arne Pedersen" - -# The version info for the project you're documenting, acts as replacement -# for |version| and |release|, also used in various other places throughout -# the built documents. -# -# The short X.Y version. -release = pyproject["version"] -version = release.split(".")[0] + "." + release.split(".")[2] - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = "en" - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False - - -# -- Options for HTML output ------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -# html_theme = 'alabaster' -html_theme = "sphinx_rtd_theme" - -# Theme options are theme-specific and customize the look and feel of a -# theme further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] - - -# -- Options for HTMLHelp output --------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = "trafficgendoc" - - -# -- Options for LaTeX output ------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass -# [howto, manual, or own class]). -latex_documents = [ - (master_doc, "trafficgen.tex", "Traffic Generator Documentation", "Tom Arne Pedersen", "manual"), -] - - -# -- Options for manual page output ------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "trafficgen", "Traffic Generator Documentation", [author], 1)] - - -# -- Options for Texinfo output ---------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "trafficgen", - "Traffic Generator Documentation", - author, - "trafficgen", - "One line description of project.", - "Miscellaneous", - ), -] diff --git a/docs/contributing.rst b/docs/contributing.rst deleted file mode 100644 index e582053..0000000 --- a/docs/contributing.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../CONTRIBUTING.rst diff --git a/docs/history.rst b/docs/history.rst deleted file mode 100644 index 2506499..0000000 --- a/docs/history.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../HISTORY.rst diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index c67c64e..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,28 +0,0 @@ -Welcome to Traffic Generator's documentation! -============================================= - -The tool generates a structured set of encounters for verifying automatic collision and -grounding avoidance systems. Based on input parameters such as desired situation, relative speed, -relative bearing etc, the tool will generate a set of traffic situations. The traffic situations -may be written to files and/or inspected using plots. - -A :download:`paper<../docs/ICMASS23_verfying_caga_systems.pdf>` is written describing the background for -the tool and how it works. - -.. toctree:: - :maxdepth: 4 - :caption: Contents: - - installation - usage - input_files - contributing - authors - history - api - -Indices and tables -================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/installation.rst b/docs/installation.rst deleted file mode 100644 index 13058cb..0000000 --- a/docs/installation.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. highlight:: shell - -============ -Installation -============ - - -Stable release --------------- - -To install Traffic Generator, run this command in your terminal: - -.. code-block:: console - - $ pip install trafficgen - -This is the preferred method to install Traffic Generator, as it will always install the most recent stable release. - -If you don't have `pip`_ installed, this `Python installation guide`_ can guide -you through the process. - -.. _pip: https://pip.pypa.io -.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ - - -From sources ------------- - -The sources for Traffic Generator can be downloaded from the https://github.com/dnv-opensource/ship-traffic-generator. - -You can either clone the public repository: - -.. code-block:: console - - $ git clone https://github.com/dnv-opensource/ship-traffic-generator - - -Once you have a copy of the source, you can install it with: - -.. code-block:: console - - $ python setup.py install - - -.. _Git repo: git clone https://github.com/dnv-opensource/ship-traffic-generator diff --git a/docs/make.bat b/docs/make.bat index ba64b82..7ecca52 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,11 +7,9 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=. +set SOURCEDIR=source set BUILDDIR=build -if "%1" == "" goto help - %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. @@ -25,6 +23,8 @@ if errorlevel 9009 ( exit /b 1 ) +if "%1" == "" goto help + %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -a -E goto end diff --git a/docs/source/CHANGELOG.md b/docs/source/CHANGELOG.md new file mode 100644 index 0000000..ff772da --- /dev/null +++ b/docs/source/CHANGELOG.md @@ -0,0 +1,2 @@ +```{include} ../../CHANGELOG.md +``` \ No newline at end of file diff --git a/docs/ICMASS23_verfying_caga_systems.pdf b/docs/source/ICMASS23_verfying_caga_systems.pdf similarity index 100% rename from docs/ICMASS23_verfying_caga_systems.pdf rename to docs/source/ICMASS23_verfying_caga_systems.pdf diff --git a/docs/source/LICENSE.md b/docs/source/LICENSE.md new file mode 100644 index 0000000..947acdb --- /dev/null +++ b/docs/source/LICENSE.md @@ -0,0 +1,3 @@ +# LICENSE +```{include} ../../LICENSE +``` \ No newline at end of file diff --git a/docs/source/README.md b/docs/source/README.md new file mode 100644 index 0000000..060259b --- /dev/null +++ b/docs/source/README.md @@ -0,0 +1,2 @@ +```{include} ../../README.md +``` \ No newline at end of file diff --git a/docs/source/STYLEGUIDE.md b/docs/source/STYLEGUIDE.md new file mode 100644 index 0000000..8648352 --- /dev/null +++ b/docs/source/STYLEGUIDE.md @@ -0,0 +1,2 @@ +```{include} ../../STYLEGUIDE.md +``` \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.check_land_crossing.rst b/docs/source/_autosummary/trafficgen.check_land_crossing.rst new file mode 100644 index 0000000..19b8c99 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.check_land_crossing.rst @@ -0,0 +1,13 @@ +trafficgen.check\_land\_crossing +================================ + +.. automodule:: trafficgen.check_land_crossing + :members: + + + + .. rubric:: Functions + .. autosummary:: + + path_crosses_land + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.encounter.rst b/docs/source/_autosummary/trafficgen.encounter.rst new file mode 100644 index 0000000..7ab14ef --- /dev/null +++ b/docs/source/_autosummary/trafficgen.encounter.rst @@ -0,0 +1,26 @@ +trafficgen.encounter +==================== + +.. automodule:: trafficgen.encounter + :members: + + + + .. rubric:: Functions + .. autosummary:: + + assign_beta + assign_beta_from_list + assign_future_position_to_target_ship + assign_sog_to_target_ship + assign_vector_time + calculate_min_vector_length_target_ship + calculate_relative_bearing + calculate_ship_cog + check_encounter_evolvement + decide_target_ship + define_own_ship + determine_colreg + find_start_position_target_ship + generate_encounter + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.marine_system_simulator.rst b/docs/source/_autosummary/trafficgen.marine_system_simulator.rst new file mode 100644 index 0000000..2cc4f23 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.marine_system_simulator.rst @@ -0,0 +1,15 @@ +trafficgen.marine\_system\_simulator +==================================== + +.. automodule:: trafficgen.marine_system_simulator + :members: + + + + .. rubric:: Functions + .. autosummary:: + + flat2llh + llh2flat + ssa + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.plot_traffic_situation.rst b/docs/source/_autosummary/trafficgen.plot_traffic_situation.rst new file mode 100644 index 0000000..c022e45 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.plot_traffic_situation.rst @@ -0,0 +1,19 @@ +trafficgen.plot\_traffic\_situation +=================================== + +.. automodule:: trafficgen.plot_traffic_situation + :members: + + + + .. rubric:: Functions + .. autosummary:: + + add_ship_to_map + add_ship_to_plot + calculate_ship_outline + calculate_vector_arrow + find_max_value_for_plot + plot_specific_traffic_situation + plot_traffic_situations + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.read_files.rst b/docs/source/_autosummary/trafficgen.read_files.rst new file mode 100644 index 0000000..eb08b2c --- /dev/null +++ b/docs/source/_autosummary/trafficgen.read_files.rst @@ -0,0 +1,25 @@ +trafficgen.read\_files +====================== + +.. automodule:: trafficgen.read_files + :members: + + + + .. rubric:: Functions + .. autosummary:: + + camel_to_snake + convert_encounters + convert_keys_to_snake_case + convert_own_ship_initial_data + convert_own_ship_waypoints + convert_settings_data_from_maritime_to_si_units + convert_ship_data_from_maritime_to_si_units + convert_situation_data_from_maritime_to_si_units + read_encounter_settings_file + read_generated_situation_files + read_own_ship_static_file + read_situation_files + read_target_ship_static_files + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.ship_traffic_generator.rst b/docs/source/_autosummary/trafficgen.ship_traffic_generator.rst new file mode 100644 index 0000000..e59d482 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.ship_traffic_generator.rst @@ -0,0 +1,13 @@ +trafficgen.ship\_traffic\_generator +=================================== + +.. automodule:: trafficgen.ship_traffic_generator + :members: + + + + .. rubric:: Functions + .. autosummary:: + + generate_traffic_situations + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.utils.rst b/docs/source/_autosummary/trafficgen.utils.rst new file mode 100644 index 0000000..ff2f0d3 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.utils.rst @@ -0,0 +1,26 @@ +trafficgen.utils +================ + +.. automodule:: trafficgen.utils + :members: + + + + .. rubric:: Functions + .. autosummary:: + + calculate_bearing_between_waypoints + calculate_destination_along_track + calculate_distance + calculate_position_along_track_using_waypoints + calculate_position_at_certain_time + convert_angle_0_to_2_pi_to_minus_pi_to_pi + convert_angle_minus_pi_to_pi_to_0_to_2_pi + deg_2_rad + knot_2_m_pr_s + m_2_nm + m_pr_s_2_knot + min_2_s + nm_2_m + rad_2_deg + \ No newline at end of file diff --git a/docs/source/_autosummary/trafficgen.write_traffic_situation_to_file.rst b/docs/source/_autosummary/trafficgen.write_traffic_situation_to_file.rst new file mode 100644 index 0000000..54e7af0 --- /dev/null +++ b/docs/source/_autosummary/trafficgen.write_traffic_situation_to_file.rst @@ -0,0 +1,15 @@ +trafficgen.write\_traffic\_situation\_to\_file +============================================== + +.. automodule:: trafficgen.write_traffic_situation_to_file + :members: + + + + .. rubric:: Functions + .. autosummary:: + + convert_ship_data_from_si_units_to_maritime + convert_situation_data_from_si_units_to__maritime + write_traffic_situations_to_json_file + \ No newline at end of file diff --git a/docs/source/_static/DNV_logo_RGB.jpg b/docs/source/_static/DNV_logo_RGB.jpg new file mode 100644 index 0000000..136fe62 Binary files /dev/null and b/docs/source/_static/DNV_logo_RGB.jpg differ diff --git a/docs/source/_static/my_package.svg b/docs/source/_static/my_package.svg new file mode 100644 index 0000000..1e02cbe --- /dev/null +++ b/docs/source/_static/my_package.svg @@ -0,0 +1 @@ +mypackagelogo svg1224 x 1223 \ No newline at end of file diff --git a/docs/source/_templates/custom-class.rst b/docs/source/_templates/custom-class.rst new file mode 100644 index 0000000..a58baba --- /dev/null +++ b/docs/source/_templates/custom-class.rst @@ -0,0 +1,30 @@ +{{ name | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + + + {% block methods %} + .. automethod:: __init__ + {% if methods %} + .. rubric:: {{ _('Methods') }} + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/source/_templates/custom-module.rst b/docs/source/_templates/custom-module.rst new file mode 100644 index 0000000..1640853 --- /dev/null +++ b/docs/source/_templates/custom-module.rst @@ -0,0 +1,67 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + :members: + {%- if classes %} + :exclude-members: {% for item in classes %}{{ item }}{{','}}{%- endfor %} + {% endif %} + + + {% block attributes %} + {%- if attributes %} + .. rubric:: {{ _('Module Attributes') }} + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {%- endblock %} + + + {%- block functions %} + {%- if functions %} + .. rubric:: {{ _('Functions') }} + .. autosummary:: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {%- endblock %} + + + {%- block classes %} + {%- if classes %} + .. rubric:: {{ _('Classes') }} + .. autosummary:: + :toctree: + :template: custom-class.rst + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {%- endblock %} + + + {%- block exceptions %} + {%- if exceptions %} + .. rubric:: {{ _('Exceptions') }} + .. autosummary:: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {%- endblock %} + + +{%- block modules %} +{%- if modules %} +.. rubric:: Modules +.. autosummary:: + :toctree: + :template: custom-module.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{%- endblock %} diff --git a/docs/api.rst b/docs/source/api.rst similarity index 55% rename from docs/api.rst rename to docs/source/api.rst index 3e977b3..dd4b477 100644 --- a/docs/api.rst +++ b/docs/source/api.rst @@ -1,5 +1,5 @@ -API Documentation -================= +API Reference +============= .. toctree:: :maxdepth: 4 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..3cbf68d --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,86 @@ +# ruff: noqa +# mypy: ignore-errors + +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import sys +from pathlib import Path + +sys.path.insert(0, str(Path("../../src").absolute())) + + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "trafficgen" +copyright = "2025, DNV AS. All rights reserved." +author = "Tom Arne Pedersen, Claas Rostock, Minos Hemrich" + +# The full version, including alpha/beta/rc tags +release = "0.7.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx_argparse_cli", + "sphinx.ext.mathjax", + "sphinx.ext.autosummary", + "sphinx.ext.todo", + "sphinxcontrib.mermaid", + "sphinx_click", +] + +# Extenstion for myst_parser +myst_enable_extensions = [ + "dollarmath", + "attrs_inline", +] + +# The file extensions of source files. +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_title = f"trafficgen {release}" +html_theme = "furo" +html_static_path = ["_static"] +html_logo = "_static/DNV_logo_RGB.jpg" +autodoc_default_options = { + "member-order": "groupwise", + "undoc-members": True, + "exclude-members": "__weakref__", +} +autodoc_preserve_defaults = True + +myst_heading_anchors = 3 + +todo_include_todos = False + +# add markdown mermaid support +myst_fence_as_directive = ["mermaid"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..2590a13 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,26 @@ +.. my-package documentation master file, created by + sphinx-quickstart on Wed Jul 6 21:16:21 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Ship Traffic Generator Documentation +==================================== + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + README + usage + input_files + api + CHANGELOG + STYLEGUIDE + LICENSE + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` diff --git a/docs/input_files.rst b/docs/source/input_files.rst similarity index 50% rename from docs/input_files.rst rename to docs/source/input_files.rst index 8d6383c..3ec3995 100644 --- a/docs/input_files.rst +++ b/docs/source/input_files.rst @@ -2,6 +2,14 @@ Input files =========== +Situation files +~~~~~~~~~~~~~~~ +The situation files specify the traffic situations to be generated. The files are written in JSON format +and a predefined set of situation files with number of encounters in a situation ranging from 1 to 3 are located in the +`src/trafficgen/data/baseline_situations_input` directory. + +Below are some examples given on how to specify a situation: + Example 1: Complete specified situation:: { @@ -10,8 +18,8 @@ Example 1: Complete specified situation:: "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, @@ -29,13 +37,12 @@ Example 1: Complete specified situation:: ] } -The values may be given in either maritime units or SI units, and which unit is used shall be specified in the `src/trafficgen/settings/encounter_settings.json` file. -The `common_vector` is given in minutes (maritime) or seconds (SI). For radar plotting (plotting vessel positions and relative motions), +The values are giben in maritime units. The `common_vector` is given in minutes. For radar plotting (plotting vessel positions and relative motions), the `common_vector` and `vector_time` are used together with ship speed to display where the ship will be in e.g. 10 minutes (Common vector is the common time vector used on a radar plot, e.g 10, 15, 20 minutes. The length of the arrow in the plot will then be the speed times this time vector). -Speed and course of the own ship, which is the ship to be tested, are given in knots and degrees (maritime) or m/s and radians (SI), respectively. -The own ship position is given both in latitudinal and longitudinal (degree/radians) together with north/east in meters from the reference point. +Speed and course of the own ship, which is the ship to be tested, are given in knots and degrees, respectively. +The own ship position is given in latitudinal and longitudinal (degree). The reference point is the initial position of own ship. An encounter may be fully described as shown above, but the user may also deside to input less data, @@ -43,7 +50,7 @@ as demonstrated in Example 2. Desired encounter type is mandatory, while the `beta`, `relative_speed` and `vector_time` parameters are optional: * `desired_encounter_type` is either head-on, overtaking-give-way, overtaking-stand-on, crossing-give-way, and crossing-stand-on. - * `beta` is the relative bearing between the own ship and the target ship as seen from the own shop, given in degrees/radians. + * `beta` is the relative bearing between the own ship and the target ship as seen from the own shop, given in degrees. * `relative_speed` is relative speed between the own ship and the target ship as seen from the own ship, such that a relative speed of 1.2 means that the target ship's speed is 20% higher than the speed of the own ship. An encounter is built using a maximum meeting distance [nm], see the paper linked in the introduction for more info. @@ -61,8 +68,8 @@ Example 2: Minimum specified situation:: "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, @@ -89,8 +96,8 @@ Example 3: Generate multiple situations using `numSituations`:: "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 0.0, @@ -116,8 +123,8 @@ Example 4: Assign range for `beta`:: "speed": 7.0, "course": 0.0, "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 } }, "encounter": [ @@ -127,3 +134,95 @@ Example 4: Assign range for `beta`:: } ] } + +Own ship file +~~~~~~~~~~~~~~~ +The own ship file specify the own ship which is the ship to be controlled by the control system under test. +The file is written in JSON format and located in the `src/trafficgen/data/own_ship`:: + + { + "dimensions": { + "length": 122, + "width": 20, + "height": 8 + }, + "sogMax": 17, + "mmsi": 257847600, + "name": "BASTO VI", + "shipType": "Passenger" + } + +The values are given in maritime units. sogMax is the maximum speed over ground in knots, and the dimensions are given in meters. + +Target ship files +~~~~~~~~~~~~~~~~~ +The directory `src/trafficgen/data/target_ships` contains a set of target ships that can be used in the traffic generation. +The file is written in JSON format and is on the following structure:: + + { + "dimensions": { + "length": 122, + "width": 20, + "height": 8 + }, + "sogMax": 17, + "shipType": "Passenger" + } + +Encounter settings +~~~~~~~~~~~~~~~~~~ +The encounter setting file spesified parameters that are common from +all encounters. The file is written in JSON format and located in the `src/trafficgen/settings/encounter_settings.json`:: + + { + "classification": { + "theta13_criteria": 67.5, + "theta14_criteria": 5.0, + "theta15_criteria": 5.0, + "theta15": [ + 112.5, + 247.5 + ] + }, + "relative_speed": { + "overtaking_stand_on": [ + 1.5, + 2 + ], + "overtaking_give_way": [ + 0.25, + 0.75 + ], + "head_on": [ + 0.5, + 1.5 + ], + "crossing_give_way": [ + 0.5, + 1.5 + ], + "crossing_stand_on": [ + 0.5, + 1.5 + ] + }, + "vector_range": [ + 10.0, + 30.0 + ], + "situation_length": 30.0, + "max_meeting_distance": 0.0, + "common_vector": 5.0, + "evolve_time": 120.0, + "disable_land_check": true + } + +The values are given in maritime units. The `theta13_criteria`, `theta14_criteria` and `theta15_criteria` are the criteria for the classification of the encounters. +The `theta15` is the range for the relative bearing between own ship and target ship. +The `relative_speed` is the range for the relative speed between own ship and target ship. +The `vector_range` is the range for the vector time. +The `situation_length` is the length of the situation in minutes. +The `max_meeting_distance` is the maximum meeting distance in nautical miles. +The `common_vector` is the common time vector used on a radar plot. +The `evolve_time` is the time in minutes for the situation to evolve. +The `disable_land_check` is a boolean value that determines if the land check should be disabled or not. diff --git a/docs/trafficgen.rst b/docs/source/trafficgen.rst similarity index 63% rename from docs/trafficgen.rst rename to docs/source/trafficgen.rst index 1530ec7..3426c91 100644 --- a/docs/trafficgen.rst +++ b/docs/source/trafficgen.rst @@ -1,24 +1,19 @@ trafficgen package ================== -.. automodule:: trafficgen - :members: - :undoc-members: - :show-inheritance: +Modules +------- -Submodules ----------- +.. autosummary:: + :toctree: _autosummary + :template: custom-module.rst + :recursive: -.. toctree:: - :maxdepth: 4 - - trafficgen.check_land_crossing - trafficgen.cli + trafficgen.ship_traffic_generator + trafficgen.read_files trafficgen.encounter + trafficgen.check_land_crossing trafficgen.marine_system_simulator trafficgen.plot_traffic_situation - trafficgen.read_files - trafficgen.ship_traffic_generator - trafficgen.types - trafficgen.utils trafficgen.write_traffic_situation_to_file + trafficgen.utils diff --git a/docs/usage.rst b/docs/source/usage.rst similarity index 100% rename from docs/usage.rst rename to docs/source/usage.rst diff --git a/docs/trafficgen.check_land_crossing.rst b/docs/trafficgen.check_land_crossing.rst deleted file mode 100644 index 19ca198..0000000 --- a/docs/trafficgen.check_land_crossing.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.check\_land\_crossing module -======================================= - -.. automodule:: trafficgen.check_land_crossing - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.cli.rst b/docs/trafficgen.cli.rst deleted file mode 100644 index 27bb6be..0000000 --- a/docs/trafficgen.cli.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.cli module -===================== - -.. automodule:: trafficgen.cli - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.encounter.rst b/docs/trafficgen.encounter.rst deleted file mode 100644 index adfccef..0000000 --- a/docs/trafficgen.encounter.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.encounter module -=========================== - -.. automodule:: trafficgen.encounter - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.marine_system_simulator.rst b/docs/trafficgen.marine_system_simulator.rst deleted file mode 100644 index 3b9290d..0000000 --- a/docs/trafficgen.marine_system_simulator.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.marine\_system\_simulator module -=========================================== - -.. automodule:: trafficgen.marine_system_simulator - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.plot_traffic_situation.rst b/docs/trafficgen.plot_traffic_situation.rst deleted file mode 100644 index 39206b2..0000000 --- a/docs/trafficgen.plot_traffic_situation.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.plot\_traffic\_situation module -========================================== - -.. automodule:: trafficgen.plot_traffic_situation - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.read_files.rst b/docs/trafficgen.read_files.rst deleted file mode 100644 index 4409f70..0000000 --- a/docs/trafficgen.read_files.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.read\_files module -============================= - -.. automodule:: trafficgen.read_files - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.ship_traffic_generator.rst b/docs/trafficgen.ship_traffic_generator.rst deleted file mode 100644 index acca72c..0000000 --- a/docs/trafficgen.ship_traffic_generator.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.ship\_traffic\_generator module -========================================== - -.. automodule:: trafficgen.ship_traffic_generator - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.types.rst b/docs/trafficgen.types.rst deleted file mode 100644 index e736371..0000000 --- a/docs/trafficgen.types.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.types module -======================= - -.. automodule:: trafficgen.types - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.utils.rst b/docs/trafficgen.utils.rst deleted file mode 100644 index 6335e60..0000000 --- a/docs/trafficgen.utils.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.utils module -======================= - -.. automodule:: trafficgen.utils - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/trafficgen.write_traffic_situation_to_file.rst b/docs/trafficgen.write_traffic_situation_to_file.rst deleted file mode 100644 index e70ec29..0000000 --- a/docs/trafficgen.write_traffic_situation_to_file.rst +++ /dev/null @@ -1,7 +0,0 @@ -trafficgen.write\_traffic\_situation\_to\_file module -===================================================== - -.. automodule:: trafficgen.write_traffic_situation_to_file - :members: - :undoc-members: - :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index e9b178c..54e0dca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,135 +1,144 @@ -[tool.poetry] +[build-system] +requires = [ + "hatchling", +] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +only-include = [ + "src/my_package", + "tests", + ".coveragerc", + ".editorconfig", + ".pre-commit-config.yaml", + "manage.py", + "pyproject.toml", + "pytest.ini", + "ruff.toml", + "uv.lock", +] + +[tool.hatch.build.targets.wheel] +packages = [ + "src/trafficgen", +] + +[project] name = "trafficgen" -version = "0.5.0" +version = "0.7.0" description = "Automatic generation of ship traffic situations from a set of predefined situations" -authors = ["Tom Arne Pedersen "] -license = "MIT License" readme = "README.md" +requires-python = ">= 3.11" +license = { file = "LICENSE" } +authors = [ + { name = "Tom Arne Pedersen", email = "Tom.Arne.Pedersen@dnv.com" }, + { name = "Claas Rostock", email = "Claas.Rostock@dnv.com" }, + { name = "Minos Hemrich", email = "Minos.Hemrich@dnv.com" }, +] +testers = [ + { name = "Grunde Løvoll", email = "Grunde.Lovoll@dnv.com" }, + { name = "Stephanie Kemna", email = "Stephanie.Kemna@dnv.com" }, +] +keywords = [ + "traffic generator", + "simulation", + "testing", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + # "Operating System :: MacOS", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "dictIO>=0.4.0", + "numpy>=1.25,<2.0", + "matplotlib>=3.7.2", + "basemap>=1.3.8", + "basemap-data-hires>=1.3.2", + "global-land-mask>=1.0.0", + "folium>=0.14.0", +] -[tool.poetry.dependencies] -python = ">=3.9, <3.13" -click = "^8.1" -click-log = "^0.4.0" -numpy = "^1.25.2" -matplotlib = "^3.7.2" -basemap = "^1.3.8" -basemap-data-hires = "^1.3.2" -global-land-mask = "^1.0.0" -folium = "^0.14.0" -pydantic = "^2.5" -maritime-schema = "^0.0.6" - -[tool.poetry.group.dev] -optional = true +[project.optional-dependencies] -[tool.poetry.group.dev.dependencies] -black = { version = "^23.12", extras = ["jupyter"] } -ruff = "^0.1.8" # linter -pyright = "^1.1.338" -tox = "^4.11.1" -pytest = "^7.4.1" -pytest-cov = "^4.1" -sourcery = "^1.14" -[tool.poetry.group.docs] -optional = true +[project.urls] +Homepage = "https://github.com/dnv-opensource/ship-traffic-generator" +# Documentation = "https://dnv-innersource.github.io/my-package/README.html" +Repository = "https://github.com/dnv-opensource/ship-traffic-generator.git" +Issues = "https://github.com/dnv-opensource/ship-traffic-generator/issues" +Changelog = "https://github.com/dnv-innersource/ship-traffic-generator/blob/main/CHANGELOG.md" -[tool.poetry.group.docs.dependencies] -sphinx = "^7.2.5" -sphinx-rtd-theme = "^1.3.0" +[dependency-groups] +dev = [ + "pytest>=8.3", + "pytest-cov>=6.0", + "ruff>=0.8.3", + "pyright>=1.1.390", + "mypy>=1.13", + "sourcery>=1.27", + "pre-commit>=4.0", + "Sphinx>=8.1", + "sphinx-argparse-cli>=1.19", + "sphinx-autodoc-typehints>=2.5", + "sphinxcontrib-mermaid>=1.0.0", + "sphinx-click>=6.0.0", + "myst-parser>=4.0", + "furo>=2024.8", + "jupyter>=1.1", + "pandas-stubs>=2.2", + "pydantic>=2.5", + "click>=8.1", + "click-log>=0.4.0", +] -# Add command line interface here like: -[tool.poetry.scripts] +[project.scripts] trafficgen = "trafficgen.cli:main" -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.pytest.ini_options] -testpaths = "tests" -addopts = "--strict-markers" -xfail_strict = true - -[tool.black] -line-length = 105 -target-version = ["py39", "py310", "py311", "py312"] - -[tool.ruff] -exclude = [ - ".git", - ".venv", - ".tox", - "build", - "dist", - "__pycache__", - "./docs/conf.py", +[tool.mypy] +plugins = [ + "numpy.typing.mypy_plugin", ] -src = ["src"] -ignore = [ - "E501", # Line length too long - # "D100", # Missing docstring in public module - # "D101", # Missing docstring in public class - # "D102", # Missing docstring in public method - # "D103", # Missing docstring in public function - # "D104", # Missing docstring in public package - "D105", # Missing docstring in magic method - "D107", # Missing docstring in __init__ - "D202", # No blank lines allowed after function docstring - "D203", # 1 blank line required before class docstring - "D205", # 1 blank line required between summary line and description - "D212", # Multi-line docstring summary should start at the first line - "D213", # Multi-line docstring summary should start at the second line - # "N802", # Function name should be lowercase (uncomment if you want to allow Uppercase function names) - # "N803", # Argument name should be lowercase (uncomment if you want to allow Uppercase argument names) - "N806", # Variable in function should be lowercase (uncomment if you want to allow Uppercase variable names in functions) - # "N815", # Variable in class scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in class scope) - # "N816", # Variable in global scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in global scope) - ] -line-length = 105 -select = [ - "E", - "D", - "F", - "N", - "W", - "I", - "B", +mypy_path = "stubs" +files = [ + "src", + "tests", ] -target-version = "py39" - -[tool.ruff.pep8-naming] -ignore-names = [ - "test_*", - "setUp", - "tearDown", +exclude = [ + "^src/folder_to_be_excluded/", +] +check_untyped_defs = true +disable_error_code = [ + "misc", + "import-untyped", ] -[tool.ruff.pydocstyle] -convention = "numpy" - -[tool.ruff.per-file-ignores] -"__init__.py" = ["I001"] -"./tests/*" = ["D"] [tool.pyright] +stubPath = "stubs" +include = [ + "src", + "tests", + "demos", +] exclude = [ - ".git", - ".venv", - ".tox", - "build", - "dist", - "**/__pycache__", - "./docs/conf.py", - "./venv", + "src/folder_to_be_excluded", ] -extraPaths = ["./src"] + typeCheckingMode = "basic" useLibraryCodeForTypes = true -# Activate the following rules step by step to (step by step..) improve code quality reportMissingParameterType = "error" reportUnknownParameterType = "warning" -reportUnknownMemberType = "warning" +reportUnknownMemberType = "warning" # consider to set to `false` if you work a lot with matplotlib and pandas, which are both not properly typed and known to trigger this warning reportMissingTypeArgument = "error" reportPropertyTypeMismatch = "error" reportFunctionMemberAccess = "warning" @@ -150,12 +159,13 @@ reportUnusedExpression = "warning" reportMatchNotExhaustive = "warning" reportShadowedImports = "warning" reportUntypedFunctionDecorator = "warning" +reportUntypedClassDecorator = "warning" reportUntypedBaseClass = "error" reportUntypedNamedTuple = "warning" - +reportUnnecessaryTypeIgnoreComment = "information" # Activate the following rules only locally and temporary, i.e. for a QA session. # (For server side CI they are considered too strict.) +# reportMissingTypeStubs = true # reportConstantRedefinition = "warning" -# reportUnnecessaryTypeIgnoreComment = "information" # reportImportCycles = "warning" # reportImplicitStringConcatenation = "warning" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..c382b54 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +testpaths = + tests +addopts = --strict-markers --verbose --durations=10 +xfail_strict = True diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..2ab2a49 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,155 @@ +exclude = [ + ".git", + ".venv", + "dist", + "*cache", + "**/__pycache__", + "src/folder_to_be_excluded", +] +src = [ + "src", +] +line-length = 120 +target-version = "py311" + +[lint] +# Settings for Ruff linter (invoked with `uv run ruff check`). +# Start by including _all_ Ruff lint rules, then ignore selected rules as needed +# https://docs.astral.sh/ruff/rules/ +select = [ + "ALL", +] +ignore = [ + # Ruff lint rules temporarily ignored, but which should be reactivated and resolved in the future. + + # Ruff lint rules considered as too strict and hence ignored + "FIX002", # Line contains TODO, consider resolving the issue + "TD003", # Missing issue link on the line following a TODO + "S101", # Use of assert detected + "RET504", # Unnecessary assignment to `result` before `return` statement + "EM101", # Exception must not use a string literal, assign to variable first + "EM102", # Exception must not use an f-string literal, assign to variable first + "TRY003", # Avoid specifying long messages outside the exception class + "PLR1711", # Useless `return` statement at end of function + "G00", # Logging statement uses string formatting ('G00' covers all rules flagging string formatting in logging, e.g. G001, G002, etc.) + "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes + "PLW0603", # Using the global statement to update {name} is discouraged + "PYI041", # Use `float` instead of `int | float` + + # Ruff lint rules recommended to keep enabled, + # but which are typical candidates you might have a need to ignore, + # especially in the beginning or when refactoring an existing codebase, + # to avoid too many Ruff errors at once. + # -> Listed here for easy access and reference. + # (uncomment to ignore) + # "N803", # Argument name should be lowercase (NOTE: ignore to allow capital arguments (e.g X) in scientific code) + # "N806", # Variable in function should be lowercase (NOTE: ignore to allow capital variables (e.g X) in scientific code) + # "TC002", # Move third-party import into a type-checking block + # "TC003", # Move standard library import into a type-checking block + + # Ruff lint rules known to be in conflict with Ruff formatter. + # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules + "W191", # Tab-indentation (in conflict with Ruff formatter) + "E111", # Indentation with invalid multiple (in conflict with Ruff formatter) + "E114", # Indentation with invalid multiple comment (in conflict with Ruff formatter) + "E117", # Over-indented (in conflict with Ruff formatter) + "D206", # Indent with spaces (in conflict with Ruff formatter) + "D300", # Triple single quotes (in conflict with Ruff formatter) + "Q000", # Bad quotes in inline string (in conflict with Ruff formatter) + "Q001", # Bad quotes in multi-line string (in conflict with Ruff formatter) + "Q002", # Bad quotes in DocString (in conflict with Ruff formatter) + "Q003", # Avoidable escaped quote (in conflict with Ruff formatter) + "COM812", # Missing trailing comma (in conflict with Ruff formatter) + "COM819", # Prohibited trailing comma (in conflict with Ruff formatter) + "ISC001", # Single-line implicit string concatenation (in conflict with Ruff formatter) + "ISC002", # Multi-line implicit string concatenation (in conflict with Ruff formatter) +] +# File patterns to be excluded from Ruff lint +# (only needed for file patterns not already listed in the common `exclude` setting +# at top of this file, i.e. list here _additional_ excludes specific to Ruff lint.) +exclude = [ +] +allowed-confusables = [ + "×", # used as dim multiplication sign in comments, such as `19×16×15×16×8×6×3 = 10,506,240 possible combinations of parameters`. +] + +[lint.pep8-naming] +ignore-names = [ + "test_*", +] + +[lint.pylint] +max-args = 10 +max-statements = 75 +max-branches = 15 + +[lint.flake8-pytest-style] +raises-require-match-for = [ + "BaseException", + "Exception", + "OSError", + "IOError", + "EnvironmentError", + "socket.error", +] + +[lint.per-file-ignores] +# `__init__.py` specific ignores +"__init__.py" = [ + "F401", # {name} imported but unused (NOTE: ignored as imports in `__init__.py` files are almost never used inside the module, but are intended for namespaces) + "I001", # Import block is un-sorted or un-formatted + "PLC0414", # Import alias does not rename original package +] +# `tests` specific ignores +"tests/**/*" = [ + "D", # Missing docstrings + "ERA001", # Found commented-out code + "PT006", # Wrong type passed to first argument of `@pytest.mark.parametrize` (NOTE: ignored to allow parameters args as "args_1,arg_2,arg_3,..." + "S101", # Use of assert detected + "PLR2004", # Magic value used in comparison + "ANN201", # Missing return type annotation for public function + "ANN202", # Missing return type annotation for private function + "ARG001", # Unused function argument: {name} + "ARG002", # Unused method argument: {name} + "INP001", # File is part of an implicit namespace package. Add an `__init__.py`. (NOTE: tests are not intended to be a module, __init__.py hence not required.) + "SLF001", # Private member accessed + "TRY004", # Prefer `TypeError` exception for invalid type +] +# `stubs` specific ignores +"stubs/**/*" = [ + "D", # Missing docstrings + "ERA001", # Found commented-out code + "SLF001", # Private member accessed + "F405", # {name} may be undefined, or defined from star imports: {module} + "F403", # from {name} import * used; unable to detect undefined names + "ANN", # Missing type annotation + "N", # Naming violations + "A001", # Variable {name} is shadowing a Python builtin + "A002", # Argument {name} is shadowing a Python builtin + "FBT001", # Boolean-typed positional argument in function definition + "PYI042", # Type alias {name} should be CamelCase + "PYI002", # complex if statement in stub + "PLR0913", # Too many arguments in function definition +] +# Jupyter notebook specific ignores +"**/*.ipynb" = [ + "D103", # Missing docstring in public function + "T201", # `print` found + "PGH003", # Use specific rule codes when ignoring type issues + "TCH002", # Move third-party import into a type-checking block +] +# `demos` specific ignores +"demos/**/*" = [ + "D", # Missing docstrings + "S101", # Use of assert detected + "PLR2004", # Magic value used in comparison + "INP001", # File is part of an implicit namespace package. Add an `__init__.py`. (NOTE: tutorials are not intended to be a module, __init__.py hence not required.) + "T201", # `print` found + "E402", # Module level import not at top of cell +] + +[lint.pydocstyle] +convention = "numpy" + +[format] +docstring-code-format = true diff --git a/src/trafficgen/check_land_crossing.py b/src/trafficgen/check_land_crossing.py index 133db1c..0e8795b 100644 --- a/src/trafficgen/check_land_crossing.py +++ b/src/trafficgen/check_land_crossing.py @@ -1,45 +1,51 @@ """Module with helper functions to determine if a generated path is crossing land.""" from global_land_mask import globe -from maritime_schema.types.caga import Position +from trafficgen.types import GeoPosition from trafficgen.utils import calculate_position_at_certain_time, rad_2_deg def path_crosses_land( - position_1: Position, + position_1: GeoPosition, speed: float, - course: float, - lat_lon0: Position, + cog: float, + lat_lon0: GeoPosition, time_interval: float = 300.0, ) -> bool: """ Find if path is crossing land. - Params: - position_1: Ship position in latitude/longitude [rad]. - speed: Ship speed [m/s]. - course: Ship course [rad]. - lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad]. - time_interval: The time interval the vessel should travel without crossing land [sec] + Parameters + ---------- + position_1 : GeoPosition + Ship position, latitudinal [rad] and longitudinal [rad]. + speed : float + Ship speed [m/s]. + cog : float + Ship course over ground [rad]. + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad]. + time_interval : float + The time interval the vessel should travel without crossing land [sec]. Default is 300.0. Returns ------- - is_on_land: True if parts of the path crosses land. + is_on_land : bool + True if parts of the path crosses land. """ - num_checks = 10 for i in range(int(time_interval / num_checks)): position_2 = calculate_position_at_certain_time( - Position(latitude=position_1.latitude, longitude=position_1.longitude), + GeoPosition(lat=position_1.lat, lon=position_1.lon), lat_lon0, speed, - course, + cog, i * time_interval / num_checks, ) - lat = rad_2_deg(position_2.latitude) - lon = rad_2_deg(position_2.longitude) - if globe.is_land(lat, lon): # type: ignore (The package is unfortunately not typed.) + lat = rad_2_deg(position_2.lat) + lon = rad_2_deg(position_2.lon) + if globe.is_land(lat, lon): # type: ignore # noqa: PGH003 return True return False diff --git a/src/trafficgen/cli.py b/src/trafficgen/cli.py index ab53dec..fc8fa63 100644 --- a/src/trafficgen/cli.py +++ b/src/trafficgen/cli.py @@ -8,6 +8,7 @@ import logging import sys from pathlib import Path +from typing import TYPE_CHECKING import click import click_log @@ -15,9 +16,11 @@ from trafficgen.plot_traffic_situation import plot_specific_traffic_situation, plot_traffic_situations from trafficgen.read_files import read_encounter_settings_file from trafficgen.ship_traffic_generator import generate_traffic_situations -from trafficgen.types import EncounterSettings from trafficgen.write_traffic_situation_to_file import write_traffic_situations_to_json_file +if TYPE_CHECKING: + from trafficgen.types import EncounterSettings + logger = logging.getLogger(__name__) _ = click_log.basic_config(logger) @@ -34,7 +37,7 @@ @click.group() @click_log.simple_verbosity_option(logger) -def main(args=None): +def main(args=None): # noqa: ANN001, ANN201, ARG001 """Entry point for console script as configured in pyproject.toml. Runs the command line interface and parses arguments and options entered on the console. @@ -110,21 +113,21 @@ def main(args=None): help="Plot individual traffic situation, specify an INTEGER value larger than 0.", ) def gen_situation( - situations, - own_ship, - targets, - settings, - visualize, - col, - row, - visualize_situation, - output, -): + situations: str, + own_ship: str, + targets: str, + settings: str, + col: int, + row: int, + visualize_situation: int, + output: str, + visualize: bool, # noqa: FBT001 +) -> None: r"""Console script for trafficgen. Example: \n trafficgen gen-situation -s ./data/example_situations_input -o ./data/test_output_1. - """ + """ # noqa: D205 click.echo("Generating traffic situations") generated_traffic_situations = generate_traffic_situations( situation_folder=Path(situations), @@ -149,13 +152,9 @@ def gen_situation( with contextlib.suppress(TypeError): if visualize_situation > 0: click.echo("Plotting a specific traffic situation") - plot_specific_traffic_situation( - generated_traffic_situations, visualize_situation, encounter_settings - ) + plot_specific_traffic_situation(generated_traffic_situations, visualize_situation, encounter_settings) else: - click.echo( - "Invalid traffic situation number specified, not creating map plot. See --help for more info." - ) + click.echo("Invalid traffic situation number specified, not creating map plot. See --help for more info.") if output is not None: click.echo("Writing traffic situations to files") write_traffic_situations_to_json_file(generated_traffic_situations, write_folder=Path(output)) diff --git a/src/trafficgen/encounter.py b/src/trafficgen/encounter.py index e1da0bd..ca0fd02 100644 --- a/src/trafficgen/encounter.py +++ b/src/trafficgen/encounter.py @@ -1,31 +1,29 @@ """ -Functions to generate encounters consisting of one own ship and one to many target ships. +Functions to generate encounters. + +The encounters consist of one own ship and one to many target ships. The generated encounters may be of type head-on, overtaking give-way and stand-on and crossing give-way and stand-on. """ import random -from typing import List, Optional, Tuple, Union -from uuid import uuid4 import numpy as np -from maritime_schema.types.caga import ( - AISNavStatus, - Initial, - OwnShip, - Position, - ShipStatic, - TargetShip, - Waypoint, -) from trafficgen.check_land_crossing import path_crosses_land from trafficgen.marine_system_simulator import flat2llh, llh2flat from trafficgen.types import ( + AisNavStatus, EncounterRelativeSpeed, EncounterSettings, EncounterType, + GeoPosition, + Initial, + OwnShip, + ShipStatic, SituationInput, + TargetShip, + Waypoint, ) from trafficgen.utils import ( calculate_bearing_between_waypoints, @@ -39,46 +37,56 @@ def generate_encounter( desired_encounter_type: EncounterType, own_ship: OwnShip, - target_ships_static: List[ShipStatic], + target_ships_static: list[ShipStatic], encounter_number: int, - beta_default: Optional[Union[List[float], float]], - relative_sog_default: Optional[float], - vector_time_default: Optional[float], + beta_default: list[float] | float | None, + relative_sog_default: float | None, + vector_time_default: float | None, settings: EncounterSettings, -) -> Tuple[TargetShip, bool]: +) -> tuple[TargetShip, bool]: """ Generate an encounter. - Params: - * desired_encounter_type: Desired encounter to be generated - * own_ship: Dict, information about own ship that will encounter a target ship - * target_ships_static: List of target ships including static information that - may be used in an encounter - * encounter_number: Integer, used to naming the target ships. target_ship_1,2 etc. - * beta_default: User defined beta. If not set, this is None. - * relative_sog_default: User defined relative sog between own ship and - target ship. If not set, this is None. - * vector_time_default: User defined vector time. If not set, this is None. - * settings: Encounter settings + Parameters + ---------- + desired_encounter_type : EncounterType + Desired encounter to be generated. + own_ship : OwnShip + Information about own ship that will encounter a target ship. + target_ships_static : list[ShipStatic] + List of target ships including static information that may be used in an encounter. + encounter_number : Int + Integer identifying the encounter. + beta_default : list[float] | float | None + User defined beta. If not set, this is None [rad]. + relative_sog_default : float | None + User defined relative sog between own ship and target ship. If not set, this is None [m/s]. + vector_time_default : float | None + User defined vector time. If not set, this is None [min]. + settings : EncounterSettings + Encounter settings Returns ------- - * target_ship: target ship information, such as initial position, sog and cog - * encounter_found: True=encounter found, False=encounter not found + target_ship : TargetShip + target ship information, such as initial position, sog and cog + encounter_found : bool + True=encounter found, False=encounter not found """ encounter_found: bool = False + target_ship_id: int = 10 # Id of first target ship outer_counter: int = 0 # Initiating some variables which later will be set if an encounter is found assert own_ship.initial is not None - target_ship_initial_position: Position = own_ship.initial.position + target_ship_initial_position: GeoPosition = own_ship.initial.position target_ship_sog: float = 0 target_ship_cog: float = 0 # Initial posision of own ship used as reference point for lat_lon0 - lat_lon0: Position = Position( - latitude=own_ship.initial.position.latitude, - longitude=own_ship.initial.position.longitude, + lat_lon0: GeoPosition = GeoPosition( + lat=own_ship.initial.position.lat, + lon=own_ship.initial.position.lon, ) target_ship_static: ShipStatic = decide_target_ship(target_ships_static) @@ -86,22 +94,25 @@ def generate_encounter( # Searching for encounter. Two loops used. Only vector time is locked in the # first loop. In the second loop, beta and sog are assigned. - while not encounter_found and outer_counter < 5: + maximum_loops = 5 + while not encounter_found and outer_counter < maximum_loops: outer_counter += 1 inner_counter: int = 0 # resetting vector_time, beta and relative_sog to default values before # new search for situation is done - vector_time: Union[float, None] = vector_time_default + vector_time: float | None = vector_time_default if vector_time is None: vector_time = random.uniform(settings.vector_range[0], settings.vector_range[1]) + + beta: float = 0.0 if beta_default is None: - beta: float = assign_beta(desired_encounter_type, settings) - elif isinstance(beta_default, List): - beta: float = assign_beta_from_list(beta_default) + beta = assign_beta(desired_encounter_type, settings) + elif isinstance(beta_default, list): + beta = assign_beta_from_list(beta_default) else: - beta: float = beta_default + beta = beta_default # Own ship assert own_ship.initial is not None @@ -117,11 +128,11 @@ def generate_encounter( ) # Target ship - target_ship_position_future: Position = assign_future_position_to_target_ship( + target_ship_position_future: GeoPosition = assign_future_position_to_target_ship( own_ship_position_future, lat_lon0, settings.max_meeting_distance ) - while not encounter_found and inner_counter < 5: + while not encounter_found and inner_counter < maximum_loops: inner_counter += 1 relative_sog = relative_sog_default if relative_sog is None: @@ -136,17 +147,17 @@ def generate_encounter( / vector_time ) - target_ship_sog: float = assign_sog_to_target_ship( + target_ship_sog = assign_sog_to_target_ship( desired_encounter_type, own_ship.initial.sog, min_target_ship_sog, settings.relative_speed, ) else: - target_ship_sog: float = relative_sog * own_ship.initial.sog + target_ship_sog = relative_sog * own_ship.initial.sog - assert target_ship_static.speed_max is not None - target_ship_sog = round(np.minimum(target_ship_sog, target_ship_static.speed_max), 1) + assert target_ship_static.sog_max is not None + target_ship_sog = round(np.minimum(target_ship_sog, target_ship_static.sog_max), 1) target_ship_vector_length = target_ship_sog * vector_time start_position_target_ship, position_found = find_start_position_target_ship( @@ -161,8 +172,8 @@ def generate_encounter( ) if position_found: - target_ship_initial_position: Position = start_position_target_ship - target_ship_cog: float = calculate_ship_cog( + target_ship_initial_position = start_position_target_ship + target_ship_cog = calculate_ship_cog( target_ship_initial_position, target_ship_position_future, lat_lon0 ) encounter_ok: bool = check_encounter_evolvement( @@ -191,17 +202,18 @@ def generate_encounter( encounter_found = encounter_ok if encounter_found: - target_ship_static.id = uuid4() + target_ship_static.id = target_ship_id + target_ship_id += 1 target_ship_static.name = f"target_ship_{encounter_number}" target_ship_initial: Initial = Initial( position=target_ship_initial_position, sog=target_ship_sog, cog=target_ship_cog, heading=target_ship_cog, - nav_status=AISNavStatus.UNDER_WAY_USING_ENGINE, + nav_status=AisNavStatus.UNDER_WAY_USING_ENGINE, ) target_ship_waypoint0 = Waypoint( - position=target_ship_initial_position.model_copy(deep=True), turn_radius=None, data=None + position=target_ship_initial_position.model_copy(deep=True), turn_radius=None, leg=None ) future_position_target_ship = calculate_position_at_certain_time( @@ -212,14 +224,10 @@ def generate_encounter( settings.situation_length, ) - target_ship_waypoint1 = Waypoint( - position=future_position_target_ship, turn_radius=None, data=None - ) + target_ship_waypoint1 = Waypoint(position=future_position_target_ship, turn_radius=None, leg=None) waypoints = [target_ship_waypoint0, target_ship_waypoint1] - target_ship = TargetShip( - static=target_ship_static, initial=target_ship_initial, waypoints=waypoints - ) + target_ship = TargetShip(static=target_ship_static, initial=target_ship_initial, waypoints=waypoints) else: # Since encounter is not found, using initial values from own ship. Will not be taken into use. target_ship = TargetShip(static=target_ship_static, initial=own_ship.initial, waypoints=None) @@ -229,37 +237,55 @@ def generate_encounter( def check_encounter_evolvement( own_ship: OwnShip, own_ship_cog: float, - own_ship_position_future: Position, - lat_lon0: Position, + own_ship_position_future: GeoPosition, + lat_lon0: GeoPosition, target_ship_sog: float, target_ship_cog: float, - target_ship_position_future: Position, + target_ship_position_future: GeoPosition, desired_encounter_type: EncounterType, - settings: EncounterSettings, + encounter_settings: EncounterSettings, ) -> bool: """ - Check encounter evolvement. The generated encounter should be the same type of + Check encounter evolvement. + + The generated encounter should be the same type of encounter (head-on, crossing, give-way) also some time before the encounter is started. - Params: - * own_ship: Own ship information such as initial position, sog and cog - * target_ship: Target ship information such as initial position, sog and cog - * desired_encounter_type: Desired type of encounter to be generated - * settings: Encounter settings + Parameters + ---------- + own_ship : OwnShip + Own ship information such as initial position, sog and cog + own_ship_cog : float + Own ship cog [rad] + own_ship_position_future : GeoPosition + Own ship future position {lat, lon} [rad]. + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] + target_ship_sog : float + Target ship speed over ground [m/s] + target_ship_cog : float + Target ship course over ground [rad] + target_ship_position_future : GeoPosition + Target ship future position {lat, lon} [rad] + desired_encounter_type : EncounterType + Desired type of encounter to be generated + encounter_settings : EncounterSettings + Encounter settings Returns ------- - * returns True if encounter ok, False if encounter not ok + encounterOK : bool + Returns True if encounter ok, False if encounter not ok """ - theta13_criteria: float = settings.classification.theta13_criteria - theta14_criteria: float = settings.classification.theta14_criteria - theta15_criteria: float = settings.classification.theta15_criteria - theta15: List[float] = settings.classification.theta15 + theta13_criteria: float = encounter_settings.classification.theta13_criteria + theta14_criteria: float = encounter_settings.classification.theta14_criteria + theta15_criteria: float = encounter_settings.classification.theta15_criteria + theta15: list[float] = encounter_settings.classification.theta15 assert own_ship.initial is not None own_ship_sog: float = own_ship.initial.sog - evolve_time: float = settings.evolve_time + evolve_time: float = encounter_settings.evolve_time # Calculating position back in time to ensure that the encounter do not change from one type # to another before the encounter is started @@ -298,27 +324,34 @@ def define_own_ship( desired_traffic_situation: SituationInput, own_ship_static: ShipStatic, encounter_settings: EncounterSettings, - lat_lon0: Position, + lat_lon0: GeoPosition, ) -> OwnShip: """ Define own ship based on information in desired traffic situation. - Params: - * desired_traffic_situation: Information about type of traffic situation to generate - * own_ship_static: Static information of own ship. - * encounter_settings: Necessary setting for the encounter - * lat_lon0: Reference position [deg] + Parameters + ---------- + desired_traffic_situation : SituationInput + Information about type of traffic situation to generate + own_ship_static : ShipStatic + Static information of own ship. + encounter_settings : EncounterSettings + Necessary setting for the encounter + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * own_ship: Own ship + own_ship : OwnShip + Own ship including static, initial and waypoints. """ own_ship_initial: Initial = desired_traffic_situation.own_ship.initial + own_ship_waypoints: list[Waypoint] = [] if desired_traffic_situation.own_ship.waypoints is None: # If waypoints are not given, let initial position be the first waypoint, # then calculate second waypoint some time in the future own_ship_waypoint0 = Waypoint( - position=own_ship_initial.position.model_copy(deep=True), turn_radius=None, data=None + position=own_ship_initial.position.model_copy(deep=True), turn_radius=None, leg=None ) ship_position_future = calculate_position_at_certain_time( own_ship_initial.position, @@ -327,17 +360,17 @@ def define_own_ship( own_ship_initial.cog, encounter_settings.situation_length, ) - own_ship_waypoint1 = Waypoint(position=ship_position_future, turn_radius=None, data=None) - own_ship_waypoints: List[Waypoint] = [own_ship_waypoint0, own_ship_waypoint1] + own_ship_waypoint1 = Waypoint(position=ship_position_future, turn_radius=None, leg=None) + own_ship_waypoints = [own_ship_waypoint0, own_ship_waypoint1] elif len(desired_traffic_situation.own_ship.waypoints) == 1: # If one waypoint is given, use initial position as first waypoint own_ship_waypoint0 = Waypoint( - position=own_ship_initial.position.model_copy(deep=True), turn_radius=None, data=None + position=own_ship_initial.position.model_copy(deep=True), turn_radius=None, leg=None ) own_ship_waypoint1 = desired_traffic_situation.own_ship.waypoints[0] - own_ship_waypoints: List[Waypoint] = [own_ship_waypoint0, own_ship_waypoint1] + own_ship_waypoints = [own_ship_waypoint0, own_ship_waypoint1] else: - own_ship_waypoints: List[Waypoint] = desired_traffic_situation.own_ship.waypoints + own_ship_waypoints = desired_traffic_situation.own_ship.waypoints own_ship = OwnShip( static=own_ship_static, @@ -349,37 +382,45 @@ def define_own_ship( def calculate_min_vector_length_target_ship( - own_ship_position: Position, + own_ship_position: GeoPosition, own_ship_cog: float, - target_ship_position_future: Position, + target_ship_position_future: GeoPosition, desired_beta: float, - lat_lon0: Position, + lat_lon0: GeoPosition, ) -> float: """ - Calculate minimum vector length (target ship sog x vector). This will - ensure that ship sog is high enough to find proper situation. - - Params: - * own_ship_position: Own ship initial position, latitudinal [rad] and longitudinal [rad] - * own_ship_cog: Own ship initial cog - * target_ship_position_future: Target ship future position - * desired_beta: Desired relative bearing between - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] + Calculate minimum vector length (target ship sog x vector). + + This is done to ensure that ship sog is high enough to find proper situation. + + Parameters + ---------- + own_ship_position : GeoPosition + Own ship initial position, latitudinal [rad] and longitudinal [rad] + own_ship_cog : float + Own ship initial cog [rad] + target_ship_position_future : GeoPosition + Target ship future position, latitudinal [rad] and longitudinal [rad] + desired_beta : float + Desired relative bearing between own ship and target ship seen from own ship [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * min_vector_length: Minimum vector length (target ship sog x vector) + min_vector_length : float + Minimum vector length (target ship sog x vector) """ psi: float = own_ship_cog + desired_beta own_ship_position_north, own_ship_position_east, _ = llh2flat( - own_ship_position.latitude, own_ship_position.longitude, lat_lon0.latitude, lat_lon0.longitude + own_ship_position.lat, own_ship_position.lon, lat_lon0.lat, lat_lon0.lon ) target_ship_position_future_north, target_ship_position_future_east, _ = llh2flat( - target_ship_position_future.latitude, - target_ship_position_future.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + target_ship_position_future.lat, + target_ship_position_future.lon, + lat_lon0.lat, + lat_lon0.lon, ) p_1 = np.array([own_ship_position_north, own_ship_position_east]) @@ -392,45 +433,55 @@ def calculate_min_vector_length_target_ship( def find_start_position_target_ship( - own_ship_position: Position, - lat_lon0: Position, + own_ship_position: GeoPosition, + lat_lon0: GeoPosition, own_ship_cog: float, - target_ship_position_future: Position, + target_ship_position_future: GeoPosition, target_ship_vector_length: float, desired_beta: float, desired_encounter_type: EncounterType, - settings: EncounterSettings, -) -> Tuple[Position, bool]: + encounter_settings: EncounterSettings, +) -> tuple[GeoPosition, bool]: """ Find start position of target ship using desired beta and vector length. - Params: - * own_ship_position: Own ship initial position, sog and cog - * own_ship_cog: Own ship initial cog - * target_ship_position_future: Target ship future position - * target_ship_vector_length: vector length (target ship sog x vector) - * desired_beta: Desired bearing between own ship and target ship seen from own ship - * desired_encounter_type: Desired type of encounter to be generated - * settings: Encounter settings + Parameters + ---------- + own_ship_position : GeoPosition + Own ship position {lat, lon} [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] + own_ship_cog : float + Own ship course over ground [rad] + target_ship_position_future : GeoPosition + Target ship future position {lat, lon} [rad] + target_ship_vector_length : float + vector length (target ship sog x vector) + desired_beta : float + Desired bearing between own ship and target ship seen from own ship [rad] + desired_encounter_type : EncounterType + Desired type of encounter to be generated + encounter_settings : EncounterSettings + Encounter settings Returns ------- - * start_position_target_ship: Dict, initial position of target ship {north, east} [m] - * start_position_found: 0=position not found, 1=position found + start_position_target_ship : GeoPosition + Initial position of target ship {lat, lon} [rad] + start_position_found : bool + False if position not found, True if position found """ - theta13_criteria: float = settings.classification.theta13_criteria - theta14_criteria: float = settings.classification.theta14_criteria - theta15_criteria: float = settings.classification.theta15_criteria - theta15: List[float] = settings.classification.theta15 + theta13_criteria: float = encounter_settings.classification.theta13_criteria + theta14_criteria: float = encounter_settings.classification.theta14_criteria + theta15_criteria: float = encounter_settings.classification.theta15_criteria + theta15: list[float] = encounter_settings.classification.theta15 - n_1, e_1, _ = llh2flat( - own_ship_position.latitude, own_ship_position.longitude, lat_lon0.latitude, lat_lon0.longitude - ) + n_1, e_1, _ = llh2flat(own_ship_position.lat, own_ship_position.lon, lat_lon0.lat, lat_lon0.lon) n_2, e_2, _ = llh2flat( - target_ship_position_future.latitude, - target_ship_position_future.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + target_ship_position_future.lat, + target_ship_position_future.lon, + lat_lon0.lat, + lat_lon0.lon, ) v_r: float = target_ship_vector_length psi: float = own_ship_cog + desired_beta @@ -439,12 +490,7 @@ def find_start_position_target_ship( e_4: float = e_1 + np.sin(psi) b: float = ( - -2 * e_2 * e_4 - - 2 * n_2 * n_4 - + 2 * e_1 * e_2 - + 2 * n_1 * n_2 - + 2 * e_1 * (e_4 - e_1) - + 2 * n_1 * (n_4 - n_1) + -2 * e_2 * e_4 - 2 * n_2 * n_4 + 2 * e_1 * e_2 + 2 * n_1 * n_2 + 2 * e_1 * (e_4 - e_1) + 2 * n_1 * (n_4 - n_1) ) a: float = (e_4 - e_1) ** 2 + (n_4 - n_1) ** 2 c: float = e_2**2 + n_2**2 - 2 * e_1 * e_2 - 2 * n_1 * n_2 - v_r**2 + e_1**2 + n_1**2 @@ -466,16 +512,16 @@ def find_start_position_target_ship( e_32 = round(e_1 + s_2 * (e_4 - e_1), 0) n_32 = round(n_1 + s_2 * (n_4 - n_1), 0) - lat31, lon31, _ = flat2llh(n_31, e_31, lat_lon0.latitude, lat_lon0.longitude) + lat31, lon31, _ = flat2llh(n_31, e_31, lat_lon0.lat, lat_lon0.lon) target_ship_cog_1: float = calculate_ship_cog( - pos_0=Position(latitude=lat31, longitude=lon31), + pos_0=GeoPosition(lat=lat31, lon=lon31), pos_1=target_ship_position_future, lat_lon0=lat_lon0, ) beta1, alpha1 = calculate_relative_bearing( position_own_ship=own_ship_position, heading_own_ship=own_ship_cog, - position_target_ship=Position(latitude=lat31, longitude=lon31), + position_target_ship=GeoPosition(lat=lat31, lon=lon31), heading_target_ship=target_ship_cog_1, lat_lon0=lat_lon0, ) @@ -483,16 +529,16 @@ def find_start_position_target_ship( alpha1, beta1, theta13_criteria, theta14_criteria, theta15_criteria, theta15 ) - lat32, lon32, _ = flat2llh(n_32, e_32, lat_lon0.latitude, lat_lon0.longitude) + lat32, lon32, _ = flat2llh(n_32, e_32, lat_lon0.lat, lat_lon0.lon) target_ship_cog_2 = calculate_ship_cog( - pos_0=Position(latitude=lat32, longitude=lon32), + pos_0=GeoPosition(lat=lat32, lon=lon32), pos_1=target_ship_position_future, lat_lon0=lat_lon0, ) beta2, alpha2 = calculate_relative_bearing( position_own_ship=own_ship_position, heading_own_ship=own_ship_cog, - position_target_ship=Position(latitude=lat32, longitude=lon32), + position_target_ship=GeoPosition(lat=lat32, lon=lon32), heading_target_ship=target_ship_cog_2, lat_lon0=lat_lon0, ) @@ -500,56 +546,61 @@ def find_start_position_target_ship( alpha2, beta2, theta13_criteria, theta14_criteria, theta15_criteria, theta15 ) + limit: float = 0.01 if ( desired_encounter_type is colreg_state1 - and np.abs(convert_angle_0_to_2_pi_to_minus_pi_to_pi(np.abs(beta1 - desired_beta))) < 0.01 + and np.abs(convert_angle_0_to_2_pi_to_minus_pi_to_pi(np.abs(beta1 - desired_beta))) < limit ): - start_position_target_ship = Position(latitude=lat31, longitude=lon31) + start_position_target_ship = GeoPosition(lat=lat31, lon=lon31) start_position_found = True elif ( desired_encounter_type is colreg_state2 - and np.abs(convert_angle_0_to_2_pi_to_minus_pi_to_pi(np.abs(beta2 - desired_beta))) < 0.01 + and np.abs(convert_angle_0_to_2_pi_to_minus_pi_to_pi(np.abs(beta2 - desired_beta))) < limit ): - start_position_target_ship = Position(latitude=lat32, longitude=lon32) + start_position_target_ship = GeoPosition(lat=lat32, lon=lon32) start_position_found = True return start_position_target_ship, start_position_found def assign_future_position_to_target_ship( - own_ship_position_future: Position, - lat_lon0: Position, + own_ship_position_future: GeoPosition, + lat_lon0: GeoPosition, max_meeting_distance: float, -) -> Position: +) -> GeoPosition: """ - Randomly assign future position of target ship. If drawing a circle with radius - max_meeting_distance around future position of own ship, future position of - target ship shall be somewhere inside this circle. + Randomly assign future position of target ship. + + If drawing a circle with radius max_meeting_distance around future position of own ship, + future position of target ship shall be somewhere inside this circle. - Params: - * own_ship_position_future: Dict, own ship position at a given time in the - future, {north, east} - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] - * max_meeting_distance: Maximum distance between own ship and target ship at - a given time in the future [m] + Parameters + ---------- + own_ship_position_future : GeoPosition + Own ship position at a given time in the future {lat, lon} [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] + max_meeting_distance : float + Maximum distance between own ship and target ship at a given time in the future [m] Returns ------- - future_position_target_ship: Future position of target ship {north, east} [m] + future_position_target_ship : GeoPosition + Future position of target ship {lat, lon} [rad] """ random_angle = random.uniform(0, 1) * 2 * np.pi random_distance = random.uniform(0, 1) * max_meeting_distance own_ship_position_future_north, own_ship_position_future_east, _ = llh2flat( - own_ship_position_future.latitude, - own_ship_position_future.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + own_ship_position_future.lat, + own_ship_position_future.lon, + lat_lon0.lat, + lat_lon0.lon, ) north: float = own_ship_position_future_north + random_distance * np.cos(random_angle) east: float = own_ship_position_future_east + random_distance * np.sin(random_angle) - latitude, longitude, _ = flat2llh(north, east, lat_lon0.latitude, lat_lon0.longitude) - return Position(latitude=latitude, longitude=longitude) + lat, lon, _ = flat2llh(north, east, lat_lon0.lat, lat_lon0.lon) + return GeoPosition(lat=lat, lon=lon) def determine_colreg( @@ -558,114 +609,115 @@ def determine_colreg( theta13_criteria: float, theta14_criteria: float, theta15_criteria: float, - theta15: List[float], + theta15: list[float], ) -> EncounterType: """ - Determine the colreg type based on alpha, relative bearing between target ship and own + Determine the colreg type. + + Colreg type is based on alpha, relative bearing between target ship and own ship seen from target ship, and beta, relative bearing between own ship and target ship seen from own ship. - Params: - * alpha: relative bearing between target ship and own ship seen from target ship - * beta: relative bearing between own ship and target ship seen from own ship - * theta13_criteria: Tolerance for "coming up with" relative bearing - * theta14_criteria: Tolerance for "reciprocal or nearly reciprocal cogs", - "when in any doubt... assume... [head-on]" - * theta15_criteria: Crossing aspect limit, used for classifying a crossing encounter - * theta15: 22.5 deg aft of the beam, used for classifying a crossing and an overtaking - encounter + Parameters + ---------- + alpha : float + Relative bearing between target ship and own ship seen from target ship [rad] + beta : float + Relative bearing between own ship and target ship seen from own ship [rad] + theta13_criteria : float + Tolerance for "coming up with" relative bearing + theta14_criteria : float + Tolerance for "reciprocal or nearly reciprocal cogs", "when in any doubt... assume... [head-on]" + theta15_criteria : float + Crossing aspect limit, used for classifying a crossing encounter + theta15 : list[float] + 22.5 deg aft of the beam, used for classifying a crossing and an overtaking encounter [rad, rad] Returns ------- - * encounter classification + encounter_classification : EncounterType + Classification of the encounter """ # Mapping alpha_2_pi: float = alpha if alpha >= 0.0 else alpha + 2 * np.pi beta_pi: float = beta if (beta >= 0.0) & (beta <= np.pi) else beta - 2 * np.pi + limit: float = 0.001 + # Find appropriate rule set - if (beta > theta15[0]) & (beta < theta15[1]) & (abs(alpha) - theta13_criteria <= 0.001): + if (beta > theta15[0]) & (beta < theta15[1]) & (abs(alpha) - theta13_criteria <= limit): return EncounterType.OVERTAKING_STAND_ON - if ( - (alpha_2_pi > theta15[0]) - & (alpha_2_pi < theta15[1]) - & (abs(beta_pi) - theta13_criteria <= 0.001) - ): + if (alpha_2_pi > theta15[0]) & (alpha_2_pi < theta15[1]) & (abs(beta_pi) - theta13_criteria <= limit): return EncounterType.OVERTAKING_GIVE_WAY - if (abs(beta_pi) - theta14_criteria <= 0.001) & (abs(alpha) - theta14_criteria <= 0.001): + if (abs(beta_pi) - theta14_criteria <= limit) & (abs(alpha) - theta14_criteria <= limit): return EncounterType.HEAD_ON - if (beta > 0) & (beta < theta15[0]) & (alpha > -theta15[0]) & (alpha - theta15_criteria <= 0.001): + if (beta > 0) & (beta < theta15[0]) & (alpha > -theta15[0]) & (alpha - theta15_criteria <= limit): return EncounterType.CROSSING_GIVE_WAY - if ( - (alpha_2_pi > 0) - & (alpha_2_pi < theta15[0]) - & (beta_pi > -theta15[0]) - & (beta_pi - theta15_criteria <= 0.001) - ): + if (alpha_2_pi > 0) & (alpha_2_pi < theta15[0]) & (beta_pi > -theta15[0]) & (beta_pi - theta15_criteria <= limit): return EncounterType.CROSSING_STAND_ON return EncounterType.NO_RISK_COLLISION def calculate_relative_bearing( - position_own_ship: Position, + position_own_ship: GeoPosition, heading_own_ship: float, - position_target_ship: Position, + position_target_ship: GeoPosition, heading_target_ship: float, - lat_lon0: Position, -) -> Tuple[float, float]: + lat_lon0: GeoPosition, +) -> tuple[float, float]: """ - Calculate relative bearing between own ship and target ship, both seen from - own ship and seen from target ship. - - Params: - * position_own_ship: Own ship position {latitude, longitude} [rad] - * heading_own_ship: Own ship heading [rad] - * position_target_ship: Target ship position {latitude, longitude} [rad] - * heading_target_ship: Target ship heading [rad] - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] + Calculate relative bearing between own ship and target ship. + + Parameters + ---------- + position_own_ship : GeoPosition + Own ship position {lat, lon} [rad] + heading_own_ship : float + Own ship heading [rad] + position_target_ship : GeoPosition + Target ship position {lat, lon} [rad] + heading_target_ship : float + Target ship heading [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * beta: relative bearing between own ship and target ship seen from own ship [rad] - * alpha: relative bearing between target ship and own ship seen from target ship [rad] + beta : float + Relative bearing between own ship and target ship seen from own ship [rad] + alpha : float + Relative bearing between target ship and own ship seen from target ship [rad] """ # POSE combination of relative bearing and contact angle - n_own_ship, e_own_ship, _ = llh2flat( - position_own_ship.latitude, position_own_ship.longitude, lat_lon0.latitude, lat_lon0.longitude - ) + n_own_ship, e_own_ship, _ = llh2flat(position_own_ship.lat, position_own_ship.lon, lat_lon0.lat, lat_lon0.lon) n_target_ship, e_target_ship, _ = llh2flat( - position_target_ship.latitude, - position_target_ship.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + position_target_ship.lat, + position_target_ship.lon, + lat_lon0.lat, + lat_lon0.lon, ) # Absolute bearing of target ship relative to own ship bng_own_ship_target_ship: float = 0.0 if e_own_ship == e_target_ship: + bng_own_ship_target_ship = 0.0 if n_own_ship <= n_target_ship else np.pi + elif e_own_ship < e_target_ship: if n_own_ship <= n_target_ship: - bng_own_ship_target_ship = 0.0 + bng_own_ship_target_ship = 1 / 2 * np.pi - np.arctan( + abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) + ) else: - bng_own_ship_target_ship = np.pi + bng_own_ship_target_ship = 1 / 2 * np.pi + np.arctan( + abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) + ) + elif n_own_ship <= n_target_ship: + bng_own_ship_target_ship = 3 / 2 * np.pi + np.arctan( + abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) + ) else: - if e_own_ship < e_target_ship: - if n_own_ship <= n_target_ship: - bng_own_ship_target_ship = 1 / 2 * np.pi - np.arctan( - abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) - ) - else: - bng_own_ship_target_ship = 1 / 2 * np.pi + np.arctan( - abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) - ) - else: - if n_own_ship <= n_target_ship: - bng_own_ship_target_ship = 3 / 2 * np.pi + np.arctan( - abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) - ) - else: - bng_own_ship_target_ship = 3 / 2 * np.pi - np.arctan( - abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) - ) + bng_own_ship_target_ship = 3 / 2 * np.pi - np.arctan( + abs(n_target_ship - n_own_ship) / abs(e_target_ship - e_own_ship) + ) # Bearing of own ship from the perspective of the contact bng_target_ship_own_ship: float = bng_own_ship_target_ship + np.pi @@ -687,20 +739,26 @@ def calculate_relative_bearing( return beta, alpha -def calculate_ship_cog(pos_0: Position, pos_1: Position, lat_lon0: Position) -> float: +def calculate_ship_cog(pos_0: GeoPosition, pos_1: GeoPosition, lat_lon0: GeoPosition) -> float: """ Calculate ship cog between two waypoints. - Params: - * waypoint_0: Dict, waypoint {latitude, longitude} [rad] - * waypoint_1: Dict, waypoint {latitude, longitude} [rad] + Parameters + ---------- + pos_0 : GeoPosition + First waypoint {lat, lon} [rad] + pos_1: GeoPosition + Second waypoint {lat, lon} [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * cog: Ship cog [rad] + cog : float + Ship coourse over ground [rad] """ - n_0, e_0, _ = llh2flat(pos_0.latitude, pos_0.longitude, lat_lon0.latitude, lat_lon0.longitude) - n_1, e_1, _ = llh2flat(pos_1.latitude, pos_1.longitude, lat_lon0.latitude, lat_lon0.longitude) + n_0, e_0, _ = llh2flat(pos_0.lat, pos_0.lon, lat_lon0.lat, lat_lon0.lon) + n_1, e_1, _ = llh2flat(pos_1.lat, pos_1.lon, lat_lon0.lat, lat_lon0.lon) cog: float = np.arctan2(e_1 - e_0, n_1 - n_0) if cog < 0.0: @@ -708,20 +766,21 @@ def calculate_ship_cog(pos_0: Position, pos_1: Position, lat_lon0: Position) -> return round(cog, 3) -def assign_vector_time(vector_time_range: List[float]): +def assign_vector_time(vector_time_range: list[float]) -> float: """ Assign random (uniform) vector time. - Params: - * vector_range: Minimum and maximum value for vector time + Parameters + ---------- + vector_time_range : list[float] + Minimum and maximum value for vector time [min] Returns ------- - * vector_time: Vector time [min] + vector_time : float + Vector time [min] """ - vector_time: float = vector_time_range[0] + random.uniform(0, 1) * ( - vector_time_range[1] - vector_time_range[0] - ) + vector_time: float = vector_time_range[0] + random.uniform(0, 1) * (vector_time_range[1] - vector_time_range[0]) return vector_time @@ -730,19 +789,25 @@ def assign_sog_to_target_ship( own_ship_sog: float, min_target_ship_sog: float, relative_sog_setting: EncounterRelativeSpeed, -): +) -> float: """ Assign random (uniform) sog to target ship depending on type of encounter. - Params: - * encounter_type: Type of encounter - * own_ship_sog: Own ship sog [m/s] - * min_target_ship_sog: Minimum target ship sog [m/s] - * relative_sog_setting: Relative sog setting dependent on encounter [-] + Parameters + ---------- + encounter_type : EncounterType + Type of encounter + own_ship_sog : float + Own ship speed over ground [m/s] + min_target_ship_sog : float + Minimum target ship speed over ground [m/s] + relative_sog_setting : EncounterRelativeSpeed + Relative speed over ground setting dependent on encounter [-] Returns ------- - * target_ship_sog: Target ship sog [m/s] + target_ship_sog : float + Target ship speed over ground [m/s] """ if encounter_type is EncounterType.OVERTAKING_STAND_ON: relative_sog = relative_sog_setting.overtaking_stand_on @@ -758,10 +823,7 @@ def assign_sog_to_target_ship( relative_sog = [0.0, 0.0] # Check that minimum target ship sog is in the relative sog range - if ( - min_target_ship_sog / own_ship_sog > relative_sog[0] - and min_target_ship_sog / own_ship_sog < relative_sog[1] - ): + if min_target_ship_sog / own_ship_sog > relative_sog[0] and min_target_ship_sog / own_ship_sog < relative_sog[1]: relative_sog[0] = min_target_ship_sog / own_ship_sog target_ship_sog: float = ( @@ -771,40 +833,49 @@ def assign_sog_to_target_ship( return target_ship_sog -def assign_beta_from_list(beta_limit: List[float]) -> float: +def assign_beta_from_list(beta_limit: list[float]) -> float: """ - Assign random (uniform) relative bearing beta between own ship - and target ship depending between the limits given by beta_limit. + Assign random (uniform) relative bearing. + + The beta between own ship and target ship depending is somewhere between + the limits given by beta_limit. - Params: - * beta_limit: Limits for beta + Parameters + ---------- + beta_limit : list[float] + Limits for beta {min, max} [rad] Returns ------- - * Relative bearing between own ship and target ship seen from own ship [rad] + relative_bearing : float + Relative bearing between own ship and target ship seen from own ship [rad] """ - assert len(beta_limit) == 2 + beta_limit_length = 2 + assert len(beta_limit) == beta_limit_length beta: float = beta_limit[0] + random.uniform(0, 1) * (beta_limit[1] - beta_limit[0]) return beta -def assign_beta(encounter_type: EncounterType, settings: EncounterSettings) -> float: +def assign_beta(encounter_type: EncounterType, encounter_settings: EncounterSettings) -> float: """ - Assign random (uniform) relative bearing beta between own ship - and target ship depending on type of encounter. + Assign random (uniform) relative bearing. - Params: - * encounter_type: Type of encounter - * settings: Encounter settings + Parameters + ---------- + encounter_type : EncounterType + Type of encounter + encounter_settings : EncounterSettings + Encounter settings Returns ------- - * Relative bearing between own ship and target ship seen from own ship [rad] + relative_bearing : float + Relative bearing between own ship and target ship seen from own ship [rad] """ - theta13_crit: float = settings.classification.theta13_criteria - theta14_crit: float = settings.classification.theta14_criteria - theta15_crit: float = settings.classification.theta15_criteria - theta15: List[float] = settings.classification.theta15 + theta13_crit: float = encounter_settings.classification.theta13_criteria + theta14_crit: float = encounter_settings.classification.theta14_criteria + theta15_crit: float = encounter_settings.classification.theta15_criteria + theta15: list[float] = encounter_settings.classification.theta15 if encounter_type is EncounterType.OVERTAKING_STAND_ON: return theta15[0] + random.uniform(0, 1) * (theta15[1] - theta15[0]) @@ -821,16 +892,19 @@ def assign_beta(encounter_type: EncounterType, settings: EncounterSettings) -> f return 0.0 -def decide_target_ship(target_ships_static: List[ShipStatic]) -> ShipStatic: +def decide_target_ship(target_ships_static: list[ShipStatic]) -> ShipStatic: """ Randomly pick a target ship from a list of target ships. - Params: - * target_ships: list of target ships with static information + Parameters + ---------- + target_ships : list[ShipStatic] + List of target ships with static information Returns ------- - * The target ship, info of type, size etc. + target_ship : ShipStatic + The target ship, info of type, size etc. """ num_target_ships: int = len(target_ships_static) target_ship_to_use: int = random.randint(1, num_target_ships) diff --git a/src/trafficgen/marine_system_simulator.py b/src/trafficgen/marine_system_simulator.py index 91438fd..552e52b 100644 --- a/src/trafficgen/marine_system_simulator.py +++ b/src/trafficgen/marine_system_simulator.py @@ -11,8 +11,6 @@ Parts of the library have been re-implemented in Python and are found below. """ -from typing import Tuple - import numpy as np @@ -23,37 +21,45 @@ def flat2llh( lon_0: float, z_n: float = 0.0, height_ref: float = 0.0, -) -> Tuple[float, float, float]: +) -> tuple[float, float, float]: """ - Compute longitude lon (rad), latitude lat (rad) and height h (m) for the - NED coordinates (xn,yn,zn). + Compute lon lon (rad), lat lat (rad) and height h (m) for the NED coordinates (xn,yn,zn). Method taken from the MSS (Marine System Simulator) toolbox which is a Matlab/Simulink library for marine systems. - The method computes longitude lon (rad), latitude lat (rad) and height h (m) for the + The method computes lon lon (rad), lat lat (rad) and height h (m) for the NED coordinates (xn,yn,zn) using a flat Earth coordinate system defined by the WGS-84 ellipsoid. The flat Earth coordinate origin is located at (lon_0, lat_0) with reference height h_ref in meters above the surface of the ellipsoid. Both height and h_ref are positive upwards, while zn is positive downwards (NED). Author: Thor I. Fossen Date: 20 July 2018 - Revisions: 2023-02-04 updates the formulas for latitude and longitude - - Params: - * xn: Ship position, north [m] - * yn: Ship position, east [m] - * zn=0.0: Ship position, down [m] - * lat_0, lon_0: Flat earth coordinate located at (lon_0, lat_0) - * h_ref=0.0: Flat earth coordinate with reference h_ref in meters above the surface - of the ellipsoid + Revisions: 2023-02-04 updates the formulas for lat and lon + + Parameters + ---------- + x_n : float + Ship position, north [m] + y_n : float + Ship position, east [m] + lat_0 : float + Flat earth coordinate located at (lon_0, lat_0) + lon_0 : float + Flat earth coordinate located at (lon_0, lat_0) + z_n : float + Ship position, down [m], default is 0.0 + h_ref : float + Flat earth coordinate with reference h_ref in meters above the surface of the ellipsoid, default is 0.0 Returns ------- - * lat: Latitude [rad] - * lon: Longitude [rad] - * h: Height [m] - + lat : float + Ship position in lat [rad] + lon : float + Ship position in lon [rad] + h : float + Ship height in meters above the surface of the ellipsoid [m] """ # WGS-84 parameters a_radius = 6378137 # Semi-major axis @@ -63,8 +69,8 @@ def flat2llh( r_n = a_radius / np.sqrt(1 - e_eccentricity**2 * np.sin(lat_0) ** 2) r_m = r_n * ((1 - e_eccentricity**2) / (1 - e_eccentricity**2 * np.sin(lat_0) ** 2)) - d_lat = x_n / (r_m + height_ref) # delta latitude dmu = mu - mu0 - d_lon = y_n / ((r_n + height_ref) * np.cos(lat_0)) # delta longitude dl = l - l0 + d_lat = x_n / (r_m + height_ref) # delta lat dmu = mu - mu0 + d_lon = y_n / ((r_n + height_ref) * np.cos(lat_0)) # delta lon dl = l - l0 lat = ssa(lat_0 + d_lat) lon = ssa(lon_0 + d_lon) @@ -80,36 +86,44 @@ def llh2flat( lon_0: float, height: float = 0.0, height_ref: float = 0.0, -) -> Tuple[float, float, float]: +) -> tuple[float, float, float]: """ - Compute (north, east) for a flat Earth coordinate system from longitude - lon (rad) and latitude lat (rad). + Compute (north, east) for a flat Earth coordinate system from lon lon (rad) and lat lat (rad). Method taken from the MSS (Marine System Simulator) toolbox which is a Matlab/Simulink library for marine systems. - The method computes (north, east) for a flat Earth coordinate system from longitude - lon (rad) and latitude lat (rad) of the WGS-84 elipsoid. The flat Earth coordinate + The method computes (north, east) for a flat Earth coordinate system from lon + lon (rad) and lat lat (rad) of the WGS-84 elipsoid. The flat Earth coordinate origin is located at (lon_0, lat_0). Author: Thor I. Fossen Date: 20 July 2018 - Revisions: 2023-02-04 updates the formulas for latitude and longitude - - Params: - * lat: Ship position in latitude [rad] - * lon: Ship position in longitude [rad] - * h=0.0: Ship height in meters above the surface of the ellipsoid - * lat_0, lon_0: Flat earth coordinate located at (lon_0, lat_0) - * h_ref=0.0: Flat earth coordinate with reference h_ref in meters above - the surface of the ellipsoid + Revisions: 2023-02-04 updates the formulas for lat and lon + + Parameters + ---------- + lat : float + Ship position in lat [rad] + lon : float + Ship position in lon [rad] + lat_0 : float + Flat earth coordinate located at (lon_0, lat_0) + lon_0 : float + Flat earth coordinate located at (lon_0, lat_0) + h : float + Ship height in meters above the surface of the ellipsoid, default is 0.0 + h_ref : float + Flat earth coordinate with reference h_ref in meters above the surface of the ellipsoid Returns ------- - * x_n: Ship position, north [m] - * y_n: Ship position, east [m] - * z_n: Ship position, down [m] + x_n : float + Ship position, north [m] + y_n : float + Ship position, east [m] + z_n : float + Ship position, down [m] """ - # WGS-84 parameters a_radius = 6378137 # Semi-major axis (equitorial radius) f_factor = 1 / 298.257223563 # Flattening @@ -142,12 +156,14 @@ def ssa(angle: float) -> float: Author: Thor I. Fossen Date: 2018-09-21 - Param: - * angle: angle given in radius + Parameters + ---------- + angle : float + Angle given in radius Returns ------- - * smallest_angle: "smallest signed angle" or the smallest difference between two angles + smallest_angle : float + "smallest signed angle" or the smallest difference between two angles """ - return np.mod(angle + np.pi, 2 * np.pi) - np.pi diff --git a/src/trafficgen/plot_traffic_situation.py b/src/trafficgen/plot_traffic_situation.py index db45ccd..da03068 100644 --- a/src/trafficgen/plot_traffic_situation.py +++ b/src/trafficgen/plot_traffic_situation.py @@ -1,43 +1,47 @@ # The matplotlib package is unfortunately not fully typed. Hence the following pyright exemption. # pyright: reportUnknownMemberType=false """Functions to prepare and plot traffic situations.""" + +import logging import math -from typing import List, Optional, Tuple, Union import matplotlib.pyplot as plt import numpy as np from folium import Map, Polygon -from maritime_schema.types.caga import Position, Ship, TargetShip, TrafficSituation -from matplotlib.axes import Axes as Axes +from matplotlib.axes import Axes from matplotlib.patches import Circle from trafficgen.marine_system_simulator import flat2llh, llh2flat -from trafficgen.types import EncounterSettings +from trafficgen.types import EncounterSettings, GeoPosition, Ship, TargetShip, TrafficSituation from trafficgen.utils import m_2_nm, rad_2_deg def calculate_vector_arrow( - position: Position, + position: GeoPosition, direction: float, vector_length: float, - lat_lon0: Position, -) -> List[Tuple[float, float]]: + lat_lon0: GeoPosition, +) -> list[tuple[float, float]]: """ Calculate the arrow with length vector pointing in the direction of ship course. - Params: - * position: {latitude}, {longitude} position of the ship [rad] - * direction: direction the arrow is pointing [rad] - * vector_length: length of vector [m] - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] + Parameters + ---------- + position : GeoPosition + {lat}, {lon} position of the ship [rad] + direction : float + Direction the arrow is pointing [rad] + vector_length :float + Length of vector [m] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * arrow_points: Polygon points to draw the arrow [deg] + arrow_points : list[tuple[float, float]] + Polygon points to draw the arrow [deg] """ - north_start, east_start, _ = llh2flat( - position.latitude, position.longitude, lat_lon0.latitude, lat_lon0.longitude - ) + north_start, east_start, _ = llh2flat(position.lat, position.lon, lat_lon0.lat, lat_lon0.lon) side_length = vector_length / 10 sides_angle = 25 @@ -50,14 +54,10 @@ def calculate_vector_arrow( north_arrow_side_2 = north_end + side_length * np.cos(direction + np.pi + sides_angle) east_arrow_side_2 = east_end + side_length * np.sin(direction + np.pi + sides_angle) - lat_start, lon_start, _ = flat2llh(north_start, east_start, lat_lon0.latitude, lat_lon0.longitude) - lat_end, lon_end, _ = flat2llh(north_end, east_end, lat_lon0.latitude, lat_lon0.longitude) - lat_arrow_side_1, lon_arrow_side_1, _ = flat2llh( - north_arrow_side_1, east_arrow_side_1, lat_lon0.latitude, lat_lon0.longitude - ) - lat_arrow_side_2, lon_arrow_side_2, _ = flat2llh( - north_arrow_side_2, east_arrow_side_2, lat_lon0.latitude, lat_lon0.longitude - ) + lat_start, lon_start, _ = flat2llh(north_start, east_start, lat_lon0.lat, lat_lon0.lon) + lat_end, lon_end, _ = flat2llh(north_end, east_end, lat_lon0.lat, lat_lon0.lon) + lat_arrow_side_1, lon_arrow_side_1, _ = flat2llh(north_arrow_side_1, east_arrow_side_1, lat_lon0.lat, lat_lon0.lon) + lat_arrow_side_2, lon_arrow_side_2, _ = flat2llh(north_arrow_side_2, east_arrow_side_2, lat_lon0.lat, lat_lon0.lon) point_1 = (rad_2_deg(lat_start), rad_2_deg(lon_start)) point_2 = (rad_2_deg(lat_end), rad_2_deg(lon_end)) @@ -68,69 +68,58 @@ def calculate_vector_arrow( def calculate_ship_outline( - position: Position, - course: float, - lat_lon0: Position, + position: GeoPosition, + cog: float, + lat_lon0: GeoPosition, ship_length: float = 100.0, ship_width: float = 15.0, -) -> List[Tuple[float, float]]: +) -> list[tuple[float, float]]: """ Calculate the outline of the ship pointing in the direction of ship course. - Params: - * position: {latitude}, {longitude} position of the ship [rad] - * course: course of the ship [rad] - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] - * ship_length: Ship length. If not given, ship length is set to 100 - * ship_width: Ship width. If not given, ship width is set to 15 + Parameters + ---------- + position : GeoPosition + {lat}, {lon} position of the ship [rad] + cog : float + Course over ground of the ship [rad] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] + ship_length : float + Ship length. If not given, ship length is set to 100 + ship_width : float + Ship width. If not given, ship width is set to 15 Returns ------- - * ship_outline_points: Polygon points to draw the ship [deg] + ship_outline_points : list[tuple[float, float]] + Polygon points to draw the ship [deg] """ - north_start, east_start, _ = llh2flat( - position.latitude, position.longitude, lat_lon0.latitude, lat_lon0.longitude - ) + north_start, east_start, _ = llh2flat(position.lat, position.lon, lat_lon0.lat, lat_lon0.lon) # increase size for visualizing ship_length *= 10 ship_width *= 10 - north_pos1 = north_start + np.cos(course) * (-ship_length / 2) - np.sin(course) * ship_width / 2 - east_pos1 = east_start + np.sin(course) * (-ship_length / 2) + np.cos(course) * ship_width / 2 - lat_pos1, lon_pos1, _ = flat2llh(north_pos1, east_pos1, lat_lon0.latitude, lat_lon0.longitude) + north_pos1 = north_start + np.cos(cog) * (-ship_length / 2) - np.sin(cog) * ship_width / 2 + east_pos1 = east_start + np.sin(cog) * (-ship_length / 2) + np.cos(cog) * ship_width / 2 + lat_pos1, lon_pos1, _ = flat2llh(north_pos1, east_pos1, lat_lon0.lat, lat_lon0.lon) - north_pos2 = ( - north_start - + np.cos(course) * (ship_length / 2 - ship_length * 0.1) - - np.sin(course) * ship_width / 2 - ) - east_pos2 = ( - east_start - + np.sin(course) * (ship_length / 2 - ship_length * 0.1) - + np.cos(course) * ship_width / 2 - ) - lat_pos2, lon_pos2, _ = flat2llh(north_pos2, east_pos2, lat_lon0.latitude, lat_lon0.longitude) + north_pos2 = north_start + np.cos(cog) * (ship_length / 2 - ship_length * 0.1) - np.sin(cog) * ship_width / 2 + east_pos2 = east_start + np.sin(cog) * (ship_length / 2 - ship_length * 0.1) + np.cos(cog) * ship_width / 2 + lat_pos2, lon_pos2, _ = flat2llh(north_pos2, east_pos2, lat_lon0.lat, lat_lon0.lon) - north_pos3 = north_start + np.cos(course) * (ship_length / 2) - east_pos3 = east_start + np.sin(course) * (ship_length / 2) - lat_pos3, lon_pos3, _ = flat2llh(north_pos3, east_pos3, lat_lon0.latitude, lat_lon0.longitude) + north_pos3 = north_start + np.cos(cog) * (ship_length / 2) + east_pos3 = east_start + np.sin(cog) * (ship_length / 2) + lat_pos3, lon_pos3, _ = flat2llh(north_pos3, east_pos3, lat_lon0.lat, lat_lon0.lon) - north_pos4 = ( - north_start - + np.cos(course) * (ship_length / 2 - ship_length * 0.1) - - np.sin(course) * (-ship_width / 2) - ) - east_pos4 = ( - east_start - + np.sin(course) * (ship_length / 2 - ship_length * 0.1) - + np.cos(course) * (-ship_width / 2) - ) - lat_pos4, lon_pos4, _ = flat2llh(north_pos4, east_pos4, lat_lon0.latitude, lat_lon0.longitude) + north_pos4 = north_start + np.cos(cog) * (ship_length / 2 - ship_length * 0.1) - np.sin(cog) * (-ship_width / 2) + east_pos4 = east_start + np.sin(cog) * (ship_length / 2 - ship_length * 0.1) + np.cos(cog) * (-ship_width / 2) + lat_pos4, lon_pos4, _ = flat2llh(north_pos4, east_pos4, lat_lon0.lat, lat_lon0.lon) - north_pos5 = north_start + np.cos(course) * (-ship_length / 2) - np.sin(course) * (-ship_width / 2) - east_pos5 = east_start + np.sin(course) * (-ship_length / 2) + np.cos(course) * (-ship_width / 2) - lat_pos5, lon_pos5, _ = flat2llh(north_pos5, east_pos5, lat_lon0.latitude, lat_lon0.longitude) + north_pos5 = north_start + np.cos(cog) * (-ship_length / 2) - np.sin(cog) * (-ship_width / 2) + east_pos5 = east_start + np.sin(cog) * (-ship_length / 2) + np.cos(cog) * (-ship_width / 2) + lat_pos5, lon_pos5, _ = flat2llh(north_pos5, east_pos5, lat_lon0.lat, lat_lon0.lon) point_1 = (rad_2_deg(lat_pos1), rad_2_deg(lon_pos1)) point_2 = (rad_2_deg(lat_pos2), rad_2_deg(lon_pos2)) @@ -142,22 +131,31 @@ def calculate_ship_outline( def plot_specific_traffic_situation( - traffic_situations: List[TrafficSituation], + traffic_situations: list[TrafficSituation], situation_number: int, encounter_settings: EncounterSettings, -): +) -> None: """ Plot a specific situation in map. - Params: - * traffic_situations: Generated traffic situations - * situation_number: The specific situation to be plotted + Parameters + ---------- + traffic_situations : list[TrafficSituation] + List of traffic situations that are generated + situation_number : int + The specific situation to be plotted + encounter_settings : EncounterSettings + Encounter settings """ - num_situations = len(traffic_situations) if situation_number > num_situations: - print( - f"Situation_number specified higher than number of situations available, plotting last situation: {num_situations}" + # Configure logging + logging.basicConfig(level=logging.INFO) + + # Replace print with logging + logging.info( + f"Situation_number specified higher than number of situations available, " + f"plotting last situation: {num_situations}" ) situation_number = num_situations @@ -168,7 +166,7 @@ def plot_specific_traffic_situation( lat_lon0 = situation.own_ship.initial.position - map_plot = Map(location=(rad_2_deg(lat_lon0.latitude), rad_2_deg(lat_lon0.longitude)), zoom_start=10) + map_plot = Map(location=(rad_2_deg(lat_lon0.lat), rad_2_deg(lat_lon0.lon)), zoom_start=10) map_plot = add_ship_to_map( situation.own_ship, encounter_settings.common_vector, @@ -177,7 +175,7 @@ def plot_specific_traffic_situation( "black", ) - target_ships: Union[List[TargetShip], None] = situation.target_ships + target_ships: list[TargetShip] | None = situation.target_ships assert target_ships is not None for target_ship in target_ships: map_plot = add_ship_to_map( @@ -193,28 +191,33 @@ def plot_specific_traffic_situation( def add_ship_to_map( ship: Ship, vector_time: float, - lat_lon0: Position, - map_plot: Optional[Map], + lat_lon0: GeoPosition, + map_plot: Map | None, color: str = "black", ) -> Map: """ Add the ship to the map. - Params: - * ship: Ship information - * vector_time: Vector time [sec] - * lat_lon0=Reference point, latitudinal [rad] and longitudinal [rad] - * map_plot: Instance of Map. If not set, instance is set to None - * color: Color of the ship. If not set, color is 'black' + Parameters + ---------- + ship : Ship + Ship information + vector_time : float + Vector time [sec] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] + map_plot : Map | None + Instance of Map. If not set, instance is set to None + color : str + Color of the ship. If not set, color is 'black' Returns ------- - * m: Updated instance of Map. + map_plot : Map + Updated instance of Map. """ if map_plot is None: - map_plot = Map( - location=(rad_2_deg(lat_lon0.latitude), rad_2_deg(lat_lon0.longitude)), zoom_start=10 - ) + map_plot = Map(location=(rad_2_deg(lat_lon0.lat), rad_2_deg(lat_lon0.lon)), zoom_start=10) assert ship.initial is not None vector_length = vector_time * ship.initial.sog @@ -238,18 +241,24 @@ def add_ship_to_map( def plot_traffic_situations( - traffic_situations: List[TrafficSituation], + traffic_situations: list[TrafficSituation], col: int, row: int, encounter_settings: EncounterSettings, -): +) -> None: """ Plot the traffic situations in one more figures. - Params: - * traffic_situations: Traffic situations to be plotted - * col: Number of columns in each figure - * row: Number of rows in each figure + Parameters + ---------- + traffic_situations : list[TrafficSituation] + List of traffic situations to be plotted + col : int + Number of columns in each figure + row : int + Number of rows in each figure + encounter_settings : EncounterSettings + Encounter settings """ max_columns = col max_rows = row @@ -289,7 +298,7 @@ def plot_traffic_situations( xlabel="[nm]", ylabel="[nm]", ) - _ = axes.set_title(situation.title) + _ = axes.set_title(str(situation.title)) assert situation.own_ship is not None assert situation.own_ship.initial assert encounter_settings.common_vector is not None @@ -322,27 +331,31 @@ def plot_traffic_situations( def find_max_value_for_plot( ship: Ship, max_value: float, - lat_lon0: Position, + lat_lon0: GeoPosition, ) -> float: """ Find the maximum deviation from the Reference point in north and east direction. - Params: - * ship: Ship information - * max_value: maximum deviation in north, east direction - * lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad] + Parameters + ---------- + ship : Ship + Ship information + max_value : float + Maximum deviation in north, east direction [m] + lat_lon0 : GeoPosition + Reference point, latitudinal [rad] and longitudinal [rad] Returns ------- - * max_value: updated maximum deviation in north, east direction + * max_value: updated maximum deviation in north, east direction [m] """ assert ship.initial is not None north, east, _ = llh2flat( - ship.initial.position.latitude, - ship.initial.position.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + ship.initial.position.lat, + ship.initial.position.lon, + lat_lon0.lat, + lat_lon0.lon, ) max_value = np.max( [ @@ -357,18 +370,23 @@ def find_max_value_for_plot( def add_ship_to_plot( ship: Ship, vector_time: float, - lat_lon0: Position, - axes: Optional[Axes], + lat_lon0: GeoPosition, + axes: Axes | None, color: str = "black", -): +) -> Axes: """ Add the ship to the plot. - Params: - * ship: Ship information - * vector_time: Vector time [sec] - * axes: Instance of figure axis. If not set, instance is set to None - * color: Color of the ship. If not set, color is 'black' + Parameters + ---------- + ship : Ship + Ship information + vector_time : float + Vector time [sec] + axes : Axes | None + Instance of figure axis. If not set, instance is set to None + color : str + Color of the ship. If not set, color is 'black' """ if axes is None: axes = plt.gca() @@ -376,10 +394,10 @@ def add_ship_to_plot( assert ship.initial is not None pos_0_north, pos_0_east, _ = llh2flat( - ship.initial.position.latitude, - ship.initial.position.longitude, - lat_lon0.latitude, - lat_lon0.longitude, + ship.initial.position.lat, + ship.initial.position.lon, + lat_lon0.lat, + lat_lon0.lon, ) pos_0_north = m_2_nm(pos_0_north) pos_0_east = m_2_nm(pos_0_east) @@ -402,7 +420,7 @@ def add_ship_to_plot( ) circle = Circle( xy=(pos_0_east, pos_0_north), - radius=vector_time / 3000.0, # type: ignore + radius=vector_time / 3000.0, color=color, ) _ = axes.add_patch(circle) diff --git a/src/trafficgen/read_files.py b/src/trafficgen/read_files.py index 29a90cb..2679e58 100644 --- a/src/trafficgen/read_files.py +++ b/src/trafficgen/read_files.py @@ -3,34 +3,38 @@ import json import os from pathlib import Path -from typing import Any, Dict, List, Union, cast -from uuid import UUID, uuid4 +from typing import Any, cast -from maritime_schema.types.caga import ( +from trafficgen.types import ( + Encounter, + EncounterSettings, + Initial, ShipStatic, + SituationInput, TrafficSituation, + Waypoint, ) - -from trafficgen.types import EncounterSettings, SituationInput from trafficgen.utils import deg_2_rad, knot_2_m_pr_s, min_2_s, nm_2_m -def read_situation_files(situation_folder: Path) -> List[SituationInput]: +def read_situation_files(situation_folder: Path) -> list[SituationInput]: """ 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 + Parameters + ---------- + situation_folder : Path + Path to the folder where situation files are found Returns ------- - * situations: List of desired traffic situations + situations : list[SituationInput] + List of desired traffic situations """ - situations: List[SituationInput] = [] + situations: list[SituationInput] = [] for file_name in sorted([file for file in os.listdir(situation_folder) if file.endswith(".json")]): - file_path = os.path.join(situation_folder, file_name) - with open(file_path, encoding="utf-8") as f: + file_path = situation_folder / file_name + with Path.open(file_path, encoding="utf-8") as f: data = json.load(f) data = convert_keys_to_snake_case(data) @@ -45,21 +49,24 @@ def read_situation_files(situation_folder: Path) -> List[SituationInput]: return situations -def read_generated_situation_files(situation_folder: Path) -> List[TrafficSituation]: +def read_generated_situation_files(situation_folder: Path) -> list[TrafficSituation]: """ Read the generated traffic situation files. Used for testing the trafficgen algorithm. - Params: - * situation_folder: Path to the folder where situation files are found + Parameters + ---------- + situation_folder : Path + Path to the folder where situation files are found Returns ------- - * situations: List of desired traffic situations + situations : list[TrafficSituation] + List of desired traffic situations """ - situations: List[TrafficSituation] = [] + situations: list[TrafficSituation] = [] for file_name in sorted([file for file in os.listdir(situation_folder) if file.endswith(".json")]): - file_path = os.path.join(situation_folder, file_name) - with open(file_path, encoding="utf-8") as f: + file_path = situation_folder / file_name + with Path.open(file_path, encoding="utf-8") as f: data = json.load(f) data = convert_keys_to_snake_case(data) @@ -72,41 +79,110 @@ def convert_situation_data_from_maritime_to_si_units(situation: SituationInput) """ Convert situation data which is given in maritime units to SI units. - Params: - * own_ship_file: Path to the own_ship_file file + Parameters + ---------- + situation : SituationInput + Situation data to be converted Returns ------- - * own_ship information + situation : SituationInput + Converted situation data """ assert situation.own_ship is not None assert situation.own_ship.initial is not None - situation.own_ship.initial.position.longitude = deg_2_rad( - situation.own_ship.initial.position.longitude - ) - situation.own_ship.initial.position.latitude = deg_2_rad( - situation.own_ship.initial.position.latitude - ) - situation.own_ship.initial.cog = deg_2_rad(situation.own_ship.initial.cog) - situation.own_ship.initial.heading = deg_2_rad(situation.own_ship.initial.heading) - situation.own_ship.initial.sog = knot_2_m_pr_s(situation.own_ship.initial.sog) + assert situation.own_ship.initial.heading is not None + situation.own_ship.initial = convert_own_ship_initial_data(situation.own_ship.initial) if situation.own_ship.waypoints is not None: - for waypoint in situation.own_ship.waypoints: - waypoint.position.latitude = deg_2_rad(waypoint.position.latitude) - waypoint.position.longitude = deg_2_rad(waypoint.position.longitude) - if waypoint.data is not None: - assert waypoint.data.model_extra - if waypoint.data.model_extra.get("sog") is not None: - waypoint.data.model_extra["sog"]["value"] = knot_2_m_pr_s(waypoint.data.model_extra["sog"]["value"]) # type: ignore + situation.own_ship.waypoints = convert_own_ship_waypoints(situation.own_ship.waypoints) assert situation.encounters is not None - for encounter in situation.encounters: - beta: Union[List[float], float, None] = encounter.beta - vector_time: Union[float, None] = encounter.vector_time + situation.encounters = convert_encounters(situation.encounters) + + return situation + + +def convert_own_ship_initial_data(initial: Initial) -> Initial: + """ + Convert own ship initial data which is given in maritime units to SI units. + + Parameters + ---------- + initial : Initial + Own ship initial data to be converted + + Returns + ------- + initial : Initial + Converted own ship initial data + """ + initial.position.lon = deg_2_rad(initial.position.lon) + initial.position.lat = deg_2_rad(initial.position.lat) + initial.cog = deg_2_rad(initial.cog) + assert initial.heading is not None + initial.heading = deg_2_rad(initial.heading) + initial.sog = knot_2_m_pr_s(initial.sog) + return initial + + +def convert_own_ship_waypoints(waypoints: list[Waypoint]) -> list[Waypoint]: + """ + Convert own ship waypoint data which is given in maritime units to SI units. + + Parameters + ---------- + waypoints : list[Waypoint] + Waypoint data to be converted + + Returns + ------- + waypoints : list[Waypoint] + Converted waypoint data + """ + for waypoint in waypoints: + waypoint.position.lat = deg_2_rad(waypoint.position.lat) + waypoint.position.lon = deg_2_rad(waypoint.position.lon) + if waypoint.turn_radius is not None: + waypoint.turn_radius = nm_2_m(waypoint.turn_radius) + if waypoint.leg is not None: + if waypoint.leg.starboard_xtd is not None: + waypoint.leg.starboard_xtd = nm_2_m(waypoint.leg.starboard_xtd) + if waypoint.leg.portside_xtd is not None: + waypoint.leg.portside_xtd = nm_2_m(waypoint.leg.portside_xtd) + if waypoint.leg.data is not None and waypoint.leg.data.sog is not None: + assert waypoint.leg.data.sog.value is not None + assert waypoint.leg.data.sog.interp_start is not None + assert waypoint.leg.data.sog.interp_end is not None + waypoint.leg.data.sog.value = knot_2_m_pr_s(waypoint.leg.data.sog.value) + waypoint.leg.data.sog.interp_start = nm_2_m(waypoint.leg.data.sog.interp_start) + waypoint.leg.data.sog.interp_end = nm_2_m(waypoint.leg.data.sog.interp_end) + return waypoints + + +def convert_encounters(encounters: list[Encounter]) -> list[Encounter]: + """ + Convert encounter data which is given in maritime units to SI units. + + Parameters + ---------- + encounters : list[Encounter] + Encounter data to be converted + + Returns + ------- + encounters : list[Encounter] + Converted encounter data + """ + assert encounters is not None + beta_list_length = 2 + + for encounter in encounters: + beta: list[float] | float | None = encounter.beta + vector_time: float | None = encounter.vector_time if beta is not None: - if isinstance(beta, List): - assert len(beta) == 2 + if isinstance(beta, list): + assert len(beta) == beta_list_length for i in range(len(beta)): beta[i] = deg_2_rad(beta[i]) encounter.beta = beta @@ -114,76 +190,108 @@ def convert_situation_data_from_maritime_to_si_units(situation: SituationInput) encounter.beta = deg_2_rad(beta) if vector_time is not None: encounter.vector_time = min_2_s(vector_time) - return situation + return encounters def read_own_ship_static_file(own_ship_static_file: Path) -> ShipStatic: """ Read own ship static data from file. - Params: - * own_ship_file: Path to the own_ship_static_file file + Parameters + ---------- + own_ship_file : Path + Path to the own_ship_static_file file Returns ------- - * own_ship static information + own_ship : ShipStatic + Own_ship static information """ - with open(own_ship_static_file, encoding="utf-8") as f: + with Path.open(own_ship_static_file, encoding="utf-8") as f: data = json.load(f) data = convert_keys_to_snake_case(data) if "id" not in data: - ship_id: UUID = uuid4() + ship_id: int = 0 data.update({"id": ship_id}) ship_static: ShipStatic = ShipStatic(**data) + ship_static = convert_ship_data_from_maritime_to_si_units(ship_static) return ship_static -def read_target_ship_static_files(target_ship_folder: Path) -> List[ShipStatic]: +def read_target_ship_static_files(target_ship_folder: Path) -> list[ShipStatic]: """ Read target ship static data files. - Params: - * target_ship_folder: Path to the folder where target ships are found + Parameters + ---------- + target_ship_folder : Path + Path to the folder where target ships are found Returns ------- - * target_ships_static: List of different target ships with static information + target_ships_static : list[ShipStatic] + List of different target ships with static information """ - target_ships_static: List[ShipStatic] = [] + target_ships_static: list[ShipStatic] = [] i = 0 for file_name in sorted([file for file in os.listdir(target_ship_folder) if file.endswith(".json")]): i = i + 1 - file_path = os.path.join(target_ship_folder, file_name) - with open(file_path, encoding="utf-8") as f: + file_path = target_ship_folder / file_name + with Path.open(file_path, encoding="utf-8") as f: data = json.load(f) data = convert_keys_to_snake_case(data) if "id" not in data: - ship_id: UUID = uuid4() + ship_id: int = 10 + i data.update({"id": ship_id}) target_ship_static: ShipStatic = ShipStatic(**data) + target_ship_static = convert_ship_data_from_maritime_to_si_units(target_ship_static) target_ships_static.append(target_ship_static) return target_ships_static +def convert_ship_data_from_maritime_to_si_units(ship: ShipStatic) -> ShipStatic: + """ + Convert ship static data which is given in maritime units to SI units. + + Parameters + ---------- + ship : ShipStatic + Ship data to be converted + + Returns + ------- + ship : ShipStatic + Converted ship data + """ + if ship.sog_max is not None: + ship.sog_max = knot_2_m_pr_s(ship.sog_max) + if ship.sog_min is not None: + ship.sog_min = knot_2_m_pr_s(ship.sog_min) + + return ship + + def read_encounter_settings_file(settings_file: Path) -> EncounterSettings: """ Read encounter settings file. - Params: - * settings_file: Path to the encounter setting file + Parameters + ---------- + settings_file : Path + Path to the encounter setting file Returns ------- - * encounter_settings: Settings for the encounter + encounter_settings : EncounterSettings + Settings for the encounter """ - with open(settings_file, encoding="utf-8") as f: + with Path.open(settings_file, encoding="utf-8") as f: data = json.load(f) - data = check_input_units(data) encounter_settings: EncounterSettings = EncounterSettings(**data) encounter_settings = convert_settings_data_from_maritime_to_si_units(encounter_settings) @@ -191,43 +299,37 @@ def read_encounter_settings_file(settings_file: Path) -> EncounterSettings: return encounter_settings -def convert_settings_data_from_maritime_to_si_units(settings: EncounterSettings) -> EncounterSettings: +def convert_settings_data_from_maritime_to_si_units(encounter_settings: EncounterSettings) -> EncounterSettings: """ Convert situation data which is given in maritime units to SI units. - Params: - * own_ship_file: Path to the own_ship_file file + Parameters + ---------- + encounter_settings : EncounterSettings + Encounter settings data to be converted Returns ------- - * own_ship information + encounter_settings : EncounterSettings + Converted encounter settings data """ - assert settings.classification is not None - - settings.classification.theta13_criteria = deg_2_rad(settings.classification.theta13_criteria) - settings.classification.theta14_criteria = deg_2_rad(settings.classification.theta14_criteria) - settings.classification.theta15_criteria = deg_2_rad(settings.classification.theta15_criteria) - settings.classification.theta15[0] = deg_2_rad(settings.classification.theta15[0]) - settings.classification.theta15[1] = deg_2_rad(settings.classification.theta15[1]) - - settings.vector_range[0] = min_2_s(settings.vector_range[0]) - settings.vector_range[1] = min_2_s(settings.vector_range[1]) + assert encounter_settings.classification is not None - settings.situation_length = min_2_s(settings.situation_length) - settings.max_meeting_distance = nm_2_m(settings.max_meeting_distance) - settings.evolve_time = min_2_s(settings.evolve_time) - settings.common_vector = min_2_s(settings.common_vector) + encounter_settings.classification.theta13_criteria = deg_2_rad(encounter_settings.classification.theta13_criteria) + encounter_settings.classification.theta14_criteria = deg_2_rad(encounter_settings.classification.theta14_criteria) + encounter_settings.classification.theta15_criteria = deg_2_rad(encounter_settings.classification.theta15_criteria) + encounter_settings.classification.theta15[0] = deg_2_rad(encounter_settings.classification.theta15[0]) + encounter_settings.classification.theta15[1] = deg_2_rad(encounter_settings.classification.theta15[1]) - return settings + encounter_settings.vector_range[0] = min_2_s(encounter_settings.vector_range[0]) + encounter_settings.vector_range[1] = min_2_s(encounter_settings.vector_range[1]) + encounter_settings.situation_length = min_2_s(encounter_settings.situation_length) + encounter_settings.max_meeting_distance = nm_2_m(encounter_settings.max_meeting_distance) + encounter_settings.evolve_time = min_2_s(encounter_settings.evolve_time) + encounter_settings.common_vector = min_2_s(encounter_settings.common_vector) -def check_input_units(data: Dict[str, Any]) -> Dict[str, Any]: - """Check if input unit is specified, if not specified it is set to SI.""" - - if "input_units" not in data: - data["input_units"] = "si" - - return data + return encounter_settings def camel_to_snake(string: str) -> str: @@ -235,33 +337,26 @@ def camel_to_snake(string: str) -> str: return "".join([f"_{c.lower()}" if c.isupper() else c for c in string]).lstrip("_") -def convert_keys_to_snake_case(data: Dict[str, Any]) -> Dict[str, Any]: +def convert_keys_to_snake_case(data: dict[str, Any]) -> dict[str, Any]: """Convert keys in a nested dictionary from camel case to snake case.""" - return cast(Dict[str, Any], _convert_keys_to_snake_case(data)) + return cast(dict[str, Any], _convert_keys_to_snake_case(data)) def _convert_keys_to_snake_case( - data: Union[Dict[str, Any], List[Any]], -) -> Union[Dict[str, Any], List[Any]]: + data: dict[str, Any] | list[Any], +) -> dict[str, Any] | list[Any]: """Convert keys in a nested dictionary from camel case to snake case.""" - - if isinstance(data, Dict): # Dict - converted_dict: Dict[str, Any] = {} + if isinstance(data, dict): # Dict + converted_dict: dict[str, Any] = {} for key, value in data.items(): converted_key = camel_to_snake(key) - if isinstance(value, (Dict, List)): - converted_value = _convert_keys_to_snake_case(value) - else: - converted_value = value + converted_value = _convert_keys_to_snake_case(value) if isinstance(value, dict | list) else value converted_dict[converted_key] = converted_value return converted_dict # List - converted_list: List[Any] = [] + converted_list: list[Any] = [] for value in data: - if isinstance(value, (Dict, List)): - converted_value = _convert_keys_to_snake_case(value) - else: - converted_value = value + converted_value = _convert_keys_to_snake_case(value) if isinstance(value, dict | list) else value converted_list.append(value) return converted_list diff --git a/src/trafficgen/settings/encounter_settings.json b/src/trafficgen/settings/encounter_settings.json index 424ddbb..122d14d 100644 --- a/src/trafficgen/settings/encounter_settings.json +++ b/src/trafficgen/settings/encounter_settings.json @@ -34,9 +34,9 @@ 10.0, 30.0 ], - "situation_length": 10.0, + "situation_length": 30.0, "max_meeting_distance": 0.0, "common_vector": 5.0, "evolve_time": 120.0, - "disable_land_check": false + "disable_land_check": true } diff --git a/src/trafficgen/ship_traffic_generator.py b/src/trafficgen/ship_traffic_generator.py index e4bcaf4..01d7e6c 100644 --- a/src/trafficgen/ship_traffic_generator.py +++ b/src/trafficgen/ship_traffic_generator.py @@ -1,15 +1,7 @@ """Functions to generate traffic situations.""" +from importlib.metadata import PackageNotFoundError, version from pathlib import Path -from typing import List, Union - -from maritime_schema.types.caga import ( - OwnShip, - Position, - ShipStatic, - TargetShip, - TrafficSituation, -) from trafficgen.encounter import ( define_own_ship, @@ -21,7 +13,21 @@ read_situation_files, read_target_ship_static_files, ) -from trafficgen.types import EncounterSettings, EncounterType, SituationInput +from trafficgen.types import ( + EncounterSettings, + EncounterType, + GeoPosition, + OwnShip, + ShipStatic, + SituationInput, + TargetShip, + TrafficSituation, +) + +try: + project_version = version("trafficgen") +except PackageNotFoundError: + project_version = "Not found" def generate_traffic_situations( @@ -29,29 +35,30 @@ def generate_traffic_situations( own_ship_file: Path, target_ship_folder: Path, settings_file: Path, -) -> List[TrafficSituation]: - """ - Generate a set of traffic situations using input files. - This is the main function for generating a set of traffic situations using input files - specifying number and type of encounter, type of target ships etc. +) -> list[TrafficSituation]: + """Generate traffic situations based on the provided input files. - Params: - * situation_folder: Path to situation folder, files describing the desired situations - * own_ship_file: Path to where own ships is found - * target_ship_folder: Path to where different type of target ships is found - * settings_file: Path to settings file + Parameters + ---------- + situation_folder : Path + Path to the folder containing situation files. + own_ship_file : Path + Path to the file containing own ship static data. + target_ship_folder : Path + Path to the folder containing target ship static files. + settings_file : Path + Path to the file containing encounter settings. Returns ------- - * traffic_situations: List of generated traffic situations. - * One situation may consist of one or more encounters. + list[TrafficSituation] + A list of generated traffic situations. """ - own_ship_static: ShipStatic = read_own_ship_static_file(own_ship_file) - target_ships_static: List[ShipStatic] = read_target_ship_static_files(target_ship_folder) + target_ships_static: list[ShipStatic] = read_target_ship_static_files(target_ship_folder) encounter_settings: EncounterSettings = read_encounter_settings_file(settings_file) - desired_traffic_situations: List[SituationInput] = read_situation_files(situation_folder) - traffic_situations: List[TrafficSituation] = [] + desired_traffic_situations: list[SituationInput] = read_situation_files(situation_folder) + traffic_situations: list[TrafficSituation] = [] for desired_traffic_situation in desired_traffic_situations: num_situations: int = desired_traffic_situation.num_situations @@ -59,18 +66,16 @@ def generate_traffic_situations( assert desired_traffic_situation.own_ship is not None assert desired_traffic_situation.encounters is not None - lat_lon0: Position = desired_traffic_situation.own_ship.initial.position + lat_lon0: GeoPosition = desired_traffic_situation.own_ship.initial.position - own_ship: OwnShip = define_own_ship( - desired_traffic_situation, own_ship_static, encounter_settings, lat_lon0 - ) + own_ship: OwnShip = define_own_ship(desired_traffic_situation, own_ship_static, encounter_settings, lat_lon0) for _ in range(num_situations): - target_ships: List[TargetShip] = [] + target_ships: list[TargetShip] = [] for i, encounter in enumerate(desired_traffic_situation.encounters): desired_encounter_type = EncounterType(encounter.desired_encounter_type) - beta: Union[List[float], float, None] = encounter.beta - relative_speed: Union[float, None] = encounter.relative_speed - vector_time: Union[float, None] = encounter.vector_time + beta: list[float] | float | None = encounter.beta + relative_speed: float | None = encounter.relative_speed + vector_time: float | None = encounter.vector_time target_ship, encounter_found = generate_encounter( desired_encounter_type, @@ -86,12 +91,12 @@ def generate_traffic_situations( target_ships.append(target_ship.model_copy(deep=True)) traffic_situation: TrafficSituation = TrafficSituation( + version=project_version, title=desired_traffic_situation.title, description=desired_traffic_situation.description, own_ship=own_ship.model_copy(deep=True), target_ships=target_ships, start_time=None, - environment=None, ) traffic_situations.append(traffic_situation) return traffic_situations diff --git a/src/trafficgen/types.py b/src/trafficgen/types.py index 97d00d3..11fc3a0 100644 --- a/src/trafficgen/types.py +++ b/src/trafficgen/types.py @@ -1,20 +1,543 @@ """Domain specific data types used in trafficgen.""" +from __future__ import annotations + +import datetime from enum import Enum -from typing import List, Optional, Union +from importlib.metadata import PackageNotFoundError, version +from typing import Annotated, Any, Self -from maritime_schema.types.caga import Initial, Waypoint -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict from pydantic.fields import Field +from pyproj import Geod + +try: + project_version = version("trafficgen") +except PackageNotFoundError: + project_version = "-.-" def to_camel(string: str) -> str: """Return a camel case formated string from snake case string.""" - words = string.split("_") return words[0] + "".join(word.capitalize() for word in words[1:]) +class BaseModelConfig(BaseModel): + """Enables the alias_generator for all cases.""" + + model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) + + +class StringIntEnumMixin(str, Enum): + """ + A mixin class for Enums that allows both integers and strings to specify a type. + + This class supports the following input formats: + - Integer: 1 + - Integer in string form: "1" + - Case-insensitive string value: "underway using engine" + - String value with underscores: "underway_using_engine" + """ + + def __init__(self, str_value: str, num_value: int) -> None: + self._value_ = str_value + self.num_value = num_value + + def __new__(cls: type[Self], str_value: str, num_value: int) -> Self: # noqa: D102 + obj = str.__new__(cls, str_value) + obj._value_ = str_value # Assign the string value + obj.num_value = num_value + return obj + + @classmethod + def _missing_(cls: type[Self], value: object) -> Self | None: + # Handle case-insensitive string matching and underscores + if isinstance(value, str): + value_str = value.replace("_", " ").lower() + for member in cls: + if member.value.lower() == value_str: + return member + # Handle numeric values disguised as strings + if value.isdigit(): + value = int(value) + # Handle numeric values + if isinstance(value, int): + for member in cls: + if member.num_value == value: # type: ignore[PGH003] + return member + return None + + +class AisShipType(StringIntEnumMixin): + """ + AIS Ship Type (not including cargo type). + + Source: https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1371-5-201402-I!!PDF-E.pdf#page=116. + """ + + NOT_AVAILABLE = ("Not available", 0) + WING_IN_GROUND = ("Wing in ground", 20) + FISHING = ("Fishing", 30) + TOWING = ("Towing", 31) + TOWING_LARGE = ("Towing large", 32) # exceeds 200m length or 25m breadth + DREDGING_OR_UNDERWATER_OPS = ("Dredging or underwater operations", 33) + DIVING_OPS = ("Diving operations", 34) + MILITARY_OPS = ("Military operations", 35) + SAILING = ("Sailing", 36) + PLEASURE_CRAFT = ("Pleasure craft", 37) + HIGH_SPEED_CRAFT = ("High speed craft", 40) + PILOT_VESSEL = ("Pilot vessel", 50) + SEARCH_AND_RESCUE_VESSEL = ("Search and rescue vessel", 51) + TUG = ("Tug", 52) + PORT_TENDER = ("Port tender", 53) + ANTI_POLLUTION_EQUIPMENT = ("Anti-pollution equipment", 54) + LAW_ENFORCEMENT = ("Law enforcement", 55) + MEDICAL_TRANSPORT = ("Medical transport", 58) + NONCOMBATANT = ("Noncombatant", 59) + PASSENGER = ("Passenger", 60) + CARGO = ("Cargo", 70) + TANKER = ("Tanker", 80) + OTHER = ("Other", 90) + + +class AisNavStatus(StringIntEnumMixin): + """ + AIS Navigational Status. + + Source: https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1371-5-201402-I!!PDF-E.pdf#page=113. + """ + + UNDER_WAY_USING_ENGINE = ("Under way using engine", 0) + AT_ANCHOR = ("At anchor", 1) + NOT_UNDER_COMMAND = ("Not under command", 2) + RESTRICTED_MANEUVERABILITY = ("Restricted maneuverability", 3) + CONSTRAINED_BY_HER_DRAUGHT = ("Constrained by her draught", 4) + MOORED = ("Moored", 5) + AGROUND = ("Aground", 6) + ENGAGED_IN_FISHING = ("Engaged in fishing", 7) + UNDER_WAY_SAILING = ("Under way sailing", 8) + RESERVED_FOR_FUTURE_AMENDMENT_DG_HS_MP_C_HSC = ( + "Reserved for future amendment DG, HS, MP, C, HSC", + 9, + ) + RESERVED_FOR_FUTURE_AMENDMENT_DG_HS_MP_A_WIG = ( + "Reserved for future amendment DG, HS, MP, A, WIG", + 10, + ) + POWER_DRIVEN_VESSEL_TOWING_ASTERN = ("Power-driven vessel towing astern", 11) + POWER_DRIVEN_VESSEL_PUSHING_AHEAD_OR_TOWING_ALONGSIDE = ( + "Power-driven vessel pushing ahead or towing alongside", + 12, + ) + RESERVED_FOR_FUTURE_USE = ("Reserved for future use", 13) + AIS_SART_ACTIVE = ("AIS-SART (active)", 14) + UNDEFINED = ("Undefined (default)", 15) + + +class PathType(str, Enum): + """Specifies the control-point model used to define the path for the ship to follow.""" + + RTZ = "rtz" + BEZIER = "bezier" + LINEAR = "linear" + + +class InterpolationMethod(str, Enum): + """Specifies the interpolation method used to interpolate between two values.""" + + LINEAR = "linear" + COSINE = "cosine" + SMOOTHSTEP = "smoothstep" + ACCELERATE = "accelerate" + DECELERATE = "decelerate" + ORDINAL = "ordinal" + + +class Dimensions(BaseModelConfig): + """ + Key Ship Dimensions. + + Bow + (a) + ^ + /┆\ + / ┆ \ + / ┆ \ + / ┆ \ + / ┆ \ + │ ┆ │ + │ ┆ │ + │ ┆ │ + │ ┆ │ + Port (c) │╌╌╌╌╌♦╌╌╌╌╌│ (d) Starboard + │ ┆ │ + │ ┆ │ + │ ┆ │ + └─────┴─────┘ + (b) + Stern + + ♦ = CCRP + + """ + + length: Annotated[float, Field(gt=0, description="Width of the ship in meters", examples=[130.0])] | None = None + width: Annotated[float, Field(gt=0, description="Width of the ship in meters", examples=[30.0])] | None = None + height: Annotated[float, Field(gt=0, description="Height of the ship in meters", examples=[15.0])] | None = None + draught: Annotated[float, Field(gt=0, description="Draught of the ship in meters", examples=[15.0])] | None = None + + a: Annotated[float, Field(gt=0, description="Distance in meters from CCRP to Bow", examples=[80])] | None = None + b: Annotated[float, Field(gt=0, description="Distance in meters from CCRP to Stern", examples=[20])] | None = None + c: Annotated[float, Field(gt=0, description="Distance in meters from CCRP to Port", examples=[20])] | None = None + d: Annotated[float, Field(gt=0, description="Distance in meters from CCRP to Starboard", examples=[20])] | None = ( + None + ) + + def __init__(self, **data: Any) -> None: # noqa: ANN401 + super().__init__(**data) + """If length and width are given, and not a, b, c, d, calculate them, and vice-versa""" + if self.length and self.width and not self.a and not self.b and not self.c and not self.d: + self.a = self.length / 2 + self.b = self.length / 2 + self.c = self.width / 2 + self.d = self.width / 2 + if self.a and self.b and self.c and self.d: + self.length = self.a + self.b + self.width = self.c + self.d + + +class ShipStatic(BaseModelConfig): + """Static ship data that will not change during the scenario.""" + + id: Annotated[int, Field(ge=0, le=2**32, description="Ship Identifier", examples=[1])] + mmsi: ( + Annotated[ + int, + Field( + ge=100000000, le=999999999, description="Maritime Mobile Service Identity (MMSI)", examples=[123456789] + ), + ] + | None + ) = None + imo: Annotated[int, Field(ge=1000000, le=9999999, description="IMO Number", examples=[1234567])] | None = None + name: Annotated[str, Field(description="Ship name", examples=["RMS Titanic"])] | None = None + + dimensions: Annotated[Dimensions, Field(description="Key ship dimensions")] | None = None + + ship_type: Annotated[AisShipType, Field(description="General ship type, based on AIS")] | None = None + + path_type: ( + Annotated[ + PathType, + Field( + default=PathType.RTZ, + description=( + "Specifies the control-point model (e.g., Bezier, RTZ) " + "used to define the path for the ship to follow." + ), + ), + ] + | None + ) = None + + sog_min: ( + Annotated[float, Field(ge=0, description="Minimum ship speed over ground in knots", examples=[5.0])] | None + ) = None + sog_max: ( + Annotated[float, Field(ge=0, description="Maximum ship speed over ground in knots", examples=[15.0])] | None + ) = None + + model_config = ConfigDict(extra="allow") + + +class GeoPosition(BaseModelConfig): + """Data type for a geographical position.""" + + lon: Annotated[float, Field(ge=-180, le=180, description="WGS-84 lon", examples=[51.2131])] + lat: Annotated[float, Field(ge=-90, le=90, description="WGS-84 lat", examples=[51.2131])] + model_config = ConfigDict(extra="allow") + + +class Position(BaseModelConfig): + """Data type for ship position.""" + + x: Annotated[float, Field(description="x-coordinate. East is positive", examples=[1123])] + y: Annotated[float, Field(description="y-coordinate. Noth is positive", examples=[231])] + + +def create_position_example() -> GeoPosition: + """Create a position class.""" + return GeoPosition(lon=57.2343, lat=10.3432) + + +class Initial(BaseModelConfig): + """Data type for initial data for a ship .""" + + position: Annotated[ + GeoPosition, + Field( + description="Initial lon and lat of the ship.", + examples=[create_position_example()], + ), + ] + sog: Annotated[float, Field(ge=0, description="Initial ship (SOG) ground in knots", examples=[10.0])] + cog: Annotated[ + float, + Field(ge=0, le=360, description="Initial ship course over ground (COG) in degrees", examples=[45.0]), + ] + heading: ( + Annotated[float, Field(ge=0, le=360, description="Initial ship heading in degrees", examples=[45.2])] | None + ) = None + nav_status: Annotated[AisNavStatus, Field(description="AIS Navigational Status")] | None = None + + +class DataPoint(BaseModelConfig): + """Data type for storing data which is numerical and continuos.""" + + value: ( + Annotated[float, Field(description="the value of the data at the current waypoint", examples=[12.3])] | None + ) = None + interp_start: ( + Annotated[ + float, + Field( + description=( + "distance before start of the next leg (NM), to start interpolating to the next leg's value" + ), + examples=[10], + ), + ] + | None + ) = None + interp_end: ( + Annotated[ + float, + Field( + description=( + "distance after the start of the next leg (NM) to finish interpolating to the next leg's value" + ), + examples=[10], + ), + ] + | None + ) = None + interp_method: Annotated[InterpolationMethod | str, Field(description="Method used for interpolation")] | None = ( + None + ) + + +data_description = ( + "The `data` field can be used to store data, which is numerical and continuous." + "One such example is the vessels speed over ground (SOG). Every `data` object, can have the 4 following attributes:" + "\n`value`: This is the value of the data over the current leg." + "\n`interpStart`: This is the distance (in NM) before the leg change, where the value will start changing" + "(via interpolation) to the new value in the next leg." + "\n`interpEnd`: This is the distance (in NM) after the leg change, where the value will finish changing" + "(via interpolation) to the new value in the next leg." + "\n`interpMethod`: This sets the interpolation (linear, cosine, smoothstep, etc.) " + "that will be used to perform the interpolation." +) + + +class RouteData(BaseModelConfig): + """Data type for data along a route.""" + + sog: Annotated[DataPoint, Field(description=data_description)] | None = None + + +class Leg(BaseModelConfig): + """Data type for a leg.""" + + starboard_xtd: Annotated[float, Field(description="Starboard XTD in NM as defined in RTZ.")] | None = None + portside_xtd: Annotated[float, Field(description="Starboard XTD in NM as defined in RTZ.")] | None = None + data: Annotated[RouteData, Field(description=data_description)] | None = None + + +class Waypoint(BaseModelConfig): + """Data type for a waypoint.""" + + position: Annotated[ + GeoPosition, + Field(description="A geographical coordinate.", examples=[GeoPosition(lon=11.2313, lat=51.2123)]), + ] + turn_radius: ( + Annotated[ + float, Field(description="Orthodrome turn radius in nautical miles as defined in RTZ.", examples=[200]) + ] + | None + ) = None + leg: Annotated[Leg, Field(description="Current Leg information.")] | None = None + + +def create_ship_static_example() -> ShipStatic: + """Create a ShipStatic class.""" + return ShipStatic( + id=1, + dimensions=Dimensions(a=50, b=50, c=10, d=10), + sog_max=20.0, + mmsi=123456789, + name="RMS Titanic", + ship_type=AisShipType.FISHING, + imo=1000001, + ) + + +def create_initial_example() -> Initial: + """Create a (Ship) Initial class.""" + return Initial( + position=create_position_example(), + sog=12.3, + cog=284.2, + heading=283.1, + nav_status=AisNavStatus.UNDER_WAY_USING_ENGINE, + ) + + +def create_data_point_example() -> DataPoint: + """Create a DataPoint class.""" + return DataPoint(value=12.3, interp_start=100, interp_end=100, interp_method=InterpolationMethod.LINEAR) + + +def create_waypoint_example() -> Waypoint: + """Create a Waypoint class.""" + return Waypoint( + position=create_position_example(), + turn_radius=1.0, + leg=Leg(data=RouteData(sog=create_data_point_example())), + ) + + +static_description = "Static ship information which does not change during a scenario." +initial_description = ( + "Initial pose of the ship. If `waypoints` are provided," + "then these should correspond to the pose of the ship at the starting waypoint" +) +waypoints_description = ( + "An array of `Waypoint` objects. Each waypoint object must have a `position` property." + "If no turn radius is provided, it will be assumed to be `0`." + "Additional data can be added to each waypoint leg." +) + + +class Ship(BaseModelConfig): + """Data type for a ship.""" + + initial: Annotated[Initial, Field(description=initial_description, examples=[create_initial_example()])] | None = ( + None + ) + waypoints: ( + Annotated[list[Waypoint], Field(description=waypoints_description, examples=[create_waypoint_example()])] | None + ) = None + + def __init__(self, **data: Any) -> None: # noqa: ANN401 + super().__init__(**data) + if not self.waypoints: + self.waypoints = self._generate_waypoints() + + def _generate_waypoints(self) -> list[Waypoint] | None: + """Generate waypoints if they don't exist.""" + waypoints = [] + + if self.initial: + # Create waypoints from initial position + g = Geod(ellps="WGS84") + lon, lat, _ = g.fwd( + self.initial.position.lon, + self.initial.position.lat, + self.initial.cog, + self.initial.sog * 0.51444 * 3600 * 3, + ) + position1 = GeoPosition(lat=lat, lon=lon) + waypoint1 = Waypoint(position=position1) + + position0 = GeoPosition( + lat=self.initial.position.lat, + lon=self.initial.position.lon, + ) + waypoint0 = Waypoint(position=position0) + + waypoints = [waypoint0, waypoint1] + return waypoints + + return None + + +class OwnShip(Ship): + """Data type for the own ship.""" + + static: Annotated[ShipStatic, Field(description=static_description, examples=[create_ship_static_example()])] + + def __init__(self, **data: Any) -> None: # noqa: ANN401 + super().__init__(**data) + if not self.static.name: + self.static.name = "OS" + + +class TargetShip(Ship): + """Data type for the target ship.""" + + static: Annotated[ShipStatic, Field(description=static_description, examples=[create_ship_static_example()])] + + def __init__(self, **data: Any) -> None: # noqa: ANN401 + super().__init__(**data) + if not self.static.name: + self.static.name = f"TGT {self.static.id}" + + +def create_ship_example() -> Ship: + """Create a Ship class.""" + return Ship( + static=create_ship_static_example(), + initial=create_initial_example(), + waypoints=[create_waypoint_example()], + ) + + +def create_own_ship_example() -> OwnShip: + """Create a OwnShip class.""" + return OwnShip(static=create_ship_static_example(), initial=create_initial_example(), waypoints=None) + + +def create_target_example() -> TargetShip: + """Create a TargetShip class.""" + return TargetShip(static=create_ship_static_example(), initial=create_initial_example(), waypoints=None) + + +class TrafficSituation(BaseModelConfig): + """Data type for a traffic situation.""" + + version: Annotated[str, Field(description="Ship traffic generator version number", examples=[project_version])] + title: ( + Annotated[str, Field(description="The title of the traffic situation", examples=["overtaking_18"])] | None + ) = None + description: ( + Annotated[ + str, + Field( + description="A description of the traffic situation", + examples=["Crossing situation with 3 target vessels in the Oslo fjord"], + ), + ] + | None + ) = None + start_time: ( + Annotated[ + datetime.datetime, + Field( + description="Starting time of the situation in `ISO 8601` format `YYYY-MM-DDThh:mm:ssZ`", + examples=[datetime.datetime(2025, 1, 1, 0, 0, 0, tzinfo=datetime.UTC)], + ), + ] + | None + ) = None + own_ship: Annotated[OwnShip, Field(description="Own Ship (OS) data", examples=[create_ship_example()])] + target_ships: ( + Annotated[list[TargetShip], Field(description="Target Ship (TGT) data", examples=[[create_ship_example()]])] + | None + ) = None + + class EncounterType(Enum): """Enumeration of encounter types.""" @@ -26,89 +549,69 @@ class EncounterType(Enum): NO_RISK_COLLISION = "noRiskCollision" -class Encounter(BaseModel): +class Encounter(BaseModelConfig): """Data type for an encounter.""" desired_encounter_type: EncounterType - beta: Union[List[float], float, None] = None - relative_speed: Union[float, None] = None - vector_time: Union[float, None] = None + beta: list[float] | float | None = None + relative_speed: float | None = None + vector_time: float | None = None - class Config: - """For converting parameters written to file from snake to camel case.""" + model_config = ConfigDict(extra="allow") - alias_generator = to_camel - populate_by_name = True - -class EncounterClassification(BaseModel): +class EncounterClassification(BaseModelConfig): """Data type for the encounter classification.""" theta13_criteria: float theta14_criteria: float theta15_criteria: float - theta15: List[float] - - class Config: - """For converting parameters written to file from snake to camel case.""" + theta15: list[float] - alias_generator = to_camel - populate_by_name = True + model_config = ConfigDict(extra="allow") -class EncounterRelativeSpeed(BaseModel): +class EncounterRelativeSpeed(BaseModelConfig): """Data type for relative speed between two ships in an encounter.""" - overtaking_stand_on: List[float] - overtaking_give_way: List[float] - head_on: List[float] - crossing_give_way: List[float] - crossing_stand_on: List[float] - - class Config: - """For converting parameters written to file from snake to camel case.""" + overtaking_stand_on: list[float] + overtaking_give_way: list[float] + head_on: list[float] + crossing_give_way: list[float] + crossing_stand_on: list[float] - alias_generator = to_camel - populate_by_name = True + model_config = ConfigDict(extra="allow") -class EncounterSettings(BaseModel): +class EncounterSettings(BaseModelConfig): """Data type for encounter settings.""" classification: EncounterClassification relative_speed: EncounterRelativeSpeed - vector_range: List[float] + vector_range: list[float] common_vector: float situation_length: float max_meeting_distance: float evolve_time: float disable_land_check: bool - class Config: - """For converting parameters written to file from snake to camel case.""" + model_config = ConfigDict(extra="allow") - alias_generator = to_camel - populate_by_name = True - -class OwnShipInitial(BaseModel): +class OwnShipInitial(BaseModelConfig): """Data type for initial data for the own ship used for generating a situation.""" initial: Initial - waypoints: Optional[List[Waypoint]] = Field(None, description="An array of `Waypoint` objects.") + waypoints: list[Waypoint] | None = Field(None, description="An array of `Waypoint` objects.") -class SituationInput(BaseModel): +class SituationInput(BaseModelConfig): """Data type for inputs needed for generating a situations.""" title: str description: str num_situations: int own_ship: OwnShipInitial - encounters: List[Encounter] - - class Config: - """For converting parameters written to file from snake to camel case.""" + encounters: list[Encounter] - alias_generator = to_camel - populate_by_name = True + model_config = ConfigDict(extra="allow") diff --git a/src/trafficgen/utils.py b/src/trafficgen/utils.py index 08710eb..14d46a9 100644 --- a/src/trafficgen/utils.py +++ b/src/trafficgen/utils.py @@ -1,25 +1,25 @@ """Utility functions that are used by several other functions.""" -from typing import List - import numpy as np -from maritime_schema.types.caga import Position, Waypoint from trafficgen.marine_system_simulator import flat2llh, llh2flat +from trafficgen.types import GeoPosition, Waypoint def knot_2_m_pr_s(speed_in_knot: float) -> float: """ Convert ship speed in knots to meters pr second. - Params: - * speed_in_knot: Ship speed given in knots + Parameters + ---------- + speed_in_knot : float + Ship speed given in knots Returns ------- - * speed_in_m_pr_s: Ship speed in meters pr second + speed_in_m_pr_s : float + Ship speed in meters pr second """ - knot_2_m_pr_sec: float = 0.5144 return speed_in_knot * knot_2_m_pr_sec @@ -28,14 +28,16 @@ def m_pr_s_2_knot(speed_in_m_pr_s: float) -> float: """ Convert ship speed in knots to meters pr second. - Params: - * speed_in_m_pr_s: Ship speed given in meters pr second + Parameters + ---------- + speed_in_m_pr_s : float + Ship speed given in meters pr second Returns ------- - * speed_in_knot: Ship speed in knots + speed_in_knot : float + Ship speed in knots """ - knot_2_m_pr_sec: float = 0.5144 return speed_in_m_pr_s / knot_2_m_pr_sec @@ -44,14 +46,16 @@ def min_2_s(time_in_min: float) -> float: """ Convert time given in minutes to time given in seconds. - Params: - * time_in_min: Time given in minutes + Parameters + ---------- + time_in_min : float + Time given in minutes Returns ------- - * time_in_s: Time in seconds + time_in_s : float + Time in seconds """ - min_2_s_coeff: float = 60.0 return time_in_min * min_2_s_coeff @@ -60,14 +64,16 @@ def m_2_nm(length_in_m: float) -> float: """ Convert length given in meters to length given in nautical miles. - Params: - * length_in_m: Length given in meters + Parameters + ---------- + length_in_m : float + Length given in meters Returns ------- - * length_in_nm: Length given in nautical miles + length_in_nm : float + Length given in nautical miles """ - m_2_nm_coeff: float = 1.0 / 1852.0 return m_2_nm_coeff * length_in_m @@ -76,14 +82,16 @@ def nm_2_m(length_in_nm: float) -> float: """ Convert length given in nautical miles to length given in meters. - Params: - * length_in_nm: Length given in nautical miles + Parameters + ---------- + length_in_nm : float + Length given in nautical miles Returns ------- - * length_in_m: Length given in meters + length_in_m : float + Length given in meters """ - nm_2_m_factor: float = 1852.0 return length_in_nm * nm_2_m_factor @@ -92,14 +100,16 @@ def deg_2_rad(angle_in_degrees: float) -> float: """ Convert angle given in degrees to angle give in radians. - Params: - * angle_in_degrees: Angle given in degrees + Parameters + ---------- + angle_in_degrees : float + Angle given in degrees Returns ------- - * angle given in radians: Angle given in radians + angle_in_radians : float + Angle given in radians """ - return angle_in_degrees * np.pi / 180.0 @@ -107,106 +117,123 @@ def rad_2_deg(angle_in_radians: float) -> float: """ Convert angle given in radians to angle give in degrees. - Params: - * angle_in_degrees: Angle given in degrees + Parameters + ---------- + angle_in_degrees : float + Angle given in degrees Returns ------- - * angle given in radians: Angle given in radians - + angle_in_radians : float + Angle given in radians """ - return angle_in_radians * 180.0 / np.pi def convert_angle_minus_pi_to_pi_to_0_to_2_pi(angle_pi: float) -> float: """ + Angle conversion functions. + Convert an angle given in the region -pi to pi degrees to an angle given in the region 0 to 2pi radians. - Params: - * angle_pi: Angle given in the region -pi to pi radians + Parameters + ---------- + angle_pi : float + Angle given in the region -pi to pi radians Returns ------- - * angle_2_pi: Angle given in the region 0 to 2pi radians + angle_2_pi : float + Angle given in the region 0 to 2pi radians """ - return angle_pi if angle_pi >= 0.0 else angle_pi + 2 * np.pi def convert_angle_0_to_2_pi_to_minus_pi_to_pi(angle_2_pi: float) -> float: """ + Angle conversion functions. + Convert an angle given in the region 0 to 2*pi degrees to an angle given in the region -pi to pi degrees. - Params: - * angle_2_pi: Angle given in the region 0 to 2pi radians + Parameters + ---------- + angle_2_pi : float + Angle given in the region 0 to 2pi radians Returns ------- - * angle_pi: Angle given in the region -pi to pi radians + angle_pi : float + Angle given in the region -pi to pi radians """ - return angle_2_pi if (angle_2_pi >= 0.0) & (angle_2_pi <= np.pi) else angle_2_pi - 2 * np.pi def calculate_position_at_certain_time( - position: Position, - lat_lon0: Position, - speed: float, - course: float, + position: GeoPosition, + lat_lon0: GeoPosition, + sog: float, + cog: float, delta_time: float, -) -> Position: +) -> GeoPosition: """ - Calculate the position of the ship at a given time based on initial position - and delta time, and constant speed and course. - - Params: - * position{latitude, longitude}: Initial ship position [rad] - * speed: Ship speed [m/s] - * course: Ship course [rad] - * delta_time: Delta time from now to the time new position is being calculated [minutes] + Calculate the position of the ship at a given time. + + The calculated position is based on initial position and delta time, in addition to constant speed and course. + + Parameters + ---------- + position : GeoPosition + Initial ship position {lat, lon} [rad] + lat_lon0 : GeoPosition + Reference position {lat, lon} [rad] + sog : float + Ship speed over ground[m/s] + cog : float + Ship course over ground [rad] + delta_time : float + Delta time from now to the time new position is being calculated [minutes] Returns ------- - * position{latitude, longitude}: Estimated ship position in delta time minutes [rad] + position : GeoPosition + Estimated ship position in delta time minutes {lat, lon} [rad] """ + north, east, _ = llh2flat(position.lat, position.lon, lat_lon0.lat, lat_lon0.lon) - north, east, _ = llh2flat( - position.latitude, position.longitude, lat_lon0.latitude, lat_lon0.longitude - ) - - north = north + speed * delta_time * np.cos(course) - east = east + speed * delta_time * np.sin(course) + north = north + sog * delta_time * np.cos(cog) + east = east + sog * delta_time * np.sin(cog) - lat_future, lon_future, _ = flat2llh(north, east, lat_lon0.latitude, lat_lon0.longitude) + lat_future, lon_future, _ = flat2llh(north, east, lat_lon0.lat, lat_lon0.lon) - position_future: Position = Position( - latitude=lat_future, - longitude=lon_future, + position_future: GeoPosition = GeoPosition( + lat=lat_future, + lon=lon_future, ) return position_future -def calculate_distance(position_prev: Position, position_next: Position) -> float: +def calculate_distance(position_prev: GeoPosition, position_next: GeoPosition) -> float: """ Calculate the distance in meter between two waypoints. - Params: - * position_prev{latitude, longitude}: Previous waypoint [rad] - * position_next{latitude, longitude}: Next waypoint [rad] + Parameters + ---------- + position_prev : GeoPosition + Previous waypoint {lat, lon}[rad] + position_next : GeoPosition + Next waypoint {lat, lon}[rad] Returns ------- - * distance: Distance between waypoints [m] + distance : float + Distance between waypoints [m] """ # Using position of previous waypoint as reference point - north_next, east_next, _ = llh2flat( - position_next.latitude, position_next.longitude, position_prev.latitude, position_prev.longitude - ) + north_next, east_next, _ = llh2flat(position_next.lat, position_next.lon, position_prev.lat, position_prev.lon) distance: float = np.sqrt(north_next**2 + east_next**2) @@ -214,30 +241,38 @@ def calculate_distance(position_prev: Position, position_next: Position) -> floa def calculate_position_along_track_using_waypoints( - waypoints: List[Waypoint], + waypoints: list[Waypoint], inital_speed: float, vector_time: float, -) -> Position: +) -> GeoPosition: """ - Calculate the position of the ship at a given time based on initial position + Calculate the position along the track using waypoints. + + The position along the track is calculated based on initial position and delta time, and constant speed and course. - Params: - * position{latitude, longitude}: Initial ship position [rad] - * speed: Ship speed [m/s] - * course: Ship course [rad] - * delta_time: Delta time from now to the time new position is being calculated [sec] + Parameters + ---------- + waypoints: list[Waypoint] + List of ship waypoints Initial ship position {lat, lon}[rad] + inital_speed : float + Initial ship speed [m/s] + vector_time : float + Delta time from now to the time new position is being calculated [sec] Returns ------- - * position{latitude, longitude}: Estimated ship position in delta time minutes [rad] + position : GeoPosition + Estimated ship position in delta time seconds {lat, lon}[rad] """ time_in_transit: float = 0 for i in range(1, len(waypoints)): ship_speed: float = inital_speed - if waypoints[i].data is not None and waypoints[i].data.model_extra["sog"] is not None: # type: ignore - ship_speed = waypoints[i].data.model_extra["sog"]["value"] # type: ignore + waypoint: Waypoint = waypoints[i] + if waypoint.leg is not None and waypoint.leg.data is not None and waypoint.leg.data.sog is not None: + assert waypoint.leg.data.sog.value is not None + ship_speed = waypoint.leg.data.sog.value dist_between_waypoints = calculate_distance(waypoints[i - 1].position, waypoints[i].position) @@ -247,59 +282,59 @@ def calculate_position_along_track_using_waypoints( if dist_travel > dist_between_waypoints: time_in_transit = time_in_transit + dist_between_waypoints / ship_speed else: - bearing = calculate_bearing_between_waypoints( - waypoints[i - 1].position, waypoints[i].position - ) - position_along_track = calculate_destination_along_track( - waypoints[i - 1].position, dist_travel, bearing - ) + bearing = calculate_bearing_between_waypoints(waypoints[i - 1].position, waypoints[i].position) + position_along_track = calculate_destination_along_track(waypoints[i - 1].position, dist_travel, bearing) return position_along_track # if ship reach last waypoint in less time than vector_time, last waypoint is used return waypoints[-1].position -def calculate_bearing_between_waypoints(position_prev: Position, position_next: Position) -> float: - """ - Calculate the bearing in rad between two waypoints. +def calculate_bearing_between_waypoints(position_prev: GeoPosition, position_next: GeoPosition) -> float: + """Calculate the bearing in rad between two waypoints. - Params: - * position_prev{latitude, longitude}: Previous waypoint [rad] - * position_next{latitude, longitude}: Next waypoint [rad] + Parameters + ---------- + position_prev : GeoPosition + Previous waypoint {lat, lon}[rad] + position_next : GeoPosition + Next waypoint {lat, lon}[rad] Returns ------- - * bearing: Bearing between waypoints [m] + bearing : float + Bearing between waypoints [rad] """ # Using position of previous waypoint as reference point - north_next, east_next, _ = llh2flat( - position_next.latitude, position_next.longitude, position_prev.latitude, position_prev.longitude - ) + north_next, east_next, _ = llh2flat(position_next.lat, position_next.lon, position_prev.lat, position_prev.lon) bearing: float = convert_angle_minus_pi_to_pi_to_0_to_2_pi(np.arctan2(east_next, north_next)) return bearing -def calculate_destination_along_track( - position_prev: Position, distance: float, bearing: float -) -> Position: +def calculate_destination_along_track(position_prev: GeoPosition, distance: float, bearing: float) -> GeoPosition: """ Calculate the destination along the track between two waypoints when distance along the track is given. - Params: - * position_prev{latitude, longitude}: Previous waypoint [rad] - * distance: Distance to travel [m] - * bearing: Bearing from previous waypoint to next waypoint [rad] + Parameters + ---------- + position_prev : GeoPosition + Previous waypoint {lat, lon}[rad] + distance : float + Distance to travel [m] + bearing : float + Bearing from previous waypoint to next waypoint [rad] Returns ------- - * destination{latitude, longitude}: Destination along the track [rad] + destination : GeoPosition + Destination along the track {lat, lon}[rad] """ north = distance * np.cos(bearing) east = distance * np.sin(bearing) - lat, lon, _ = flat2llh(north, east, position_prev.latitude, position_prev.longitude) - destination = Position(latitude=lat, longitude=lon) + lat, lon, _ = flat2llh(north, east, position_prev.lat, position_prev.lon) + destination = GeoPosition(lat=lat, lon=lon) return destination diff --git a/src/trafficgen/write_traffic_situation_to_file.py b/src/trafficgen/write_traffic_situation_to_file.py index 8201875..5f666e0 100644 --- a/src/trafficgen/write_traffic_situation_to_file.py +++ b/src/trafficgen/write_traffic_situation_to_file.py @@ -1,53 +1,69 @@ """Functions to clean traffic situations data before writing it to a json file.""" +import json from pathlib import Path -from typing import List, TypeVar +from typing import Any, TypeVar -from maritime_schema.types.caga import OwnShip, Ship, TargetShip, TrafficSituation - -from trafficgen.utils import m_pr_s_2_knot, rad_2_deg +from trafficgen.types import OwnShip, Ship, TargetShip, TrafficSituation +from trafficgen.utils import m_2_nm, m_pr_s_2_knot, rad_2_deg T_ship = TypeVar("T_ship", Ship, OwnShip, TargetShip) -def write_traffic_situations_to_json_file(situations: List[TrafficSituation], write_folder: Path): +def write_traffic_situations_to_json_file(situations: list[TrafficSituation], write_folder: Path) -> None: """ Write traffic situations to json file. - Params: - * traffic_situations: Traffic situations to be written to file - * write_folder: Folder where the json files is to be written + 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 """ - Path(write_folder).mkdir(parents=True, exist_ok=True) for i, situation in enumerate(situations): file_number: int = i + 1 output_file_path: Path = write_folder / f"traffic_situation_{file_number:02d}.json" - situation = convert_situation_data_from_si_units_to__maritime(situation) - data: str = situation.model_dump_json( - by_alias=True, indent=4, exclude_unset=True, exclude_defaults=False, exclude_none=True + situation = convert_situation_data_from_si_units_to__maritime(situation) # noqa: PLW2901 + data: dict[str, Any] = situation.model_dump( + by_alias=True, exclude_unset=True, exclude_defaults=False, exclude_none=True ) - with open(output_file_path, "w", encoding="utf-8") as outfile: - _ = outfile.write(data) + + # Remove the 'sogMax' field from the 'static' dictionary in ownShip + if "static" in data.get("ownShip", {}): + data["ownShip"]["static"].pop("sogMax", None) + + # Remove the 'sogMax' field from the 'static' dictionary in each targetShip + for target_ship in data.get("targetShips", []): + if "static" in target_ship: + target_ship["static"].pop("sogMax", None) + + json_data: str = json.dumps(data, indent=4) + with Path.open(output_file_path, "w", encoding="utf-8") as outfile: + _ = outfile.write(json_data) def convert_situation_data_from_si_units_to__maritime(situation: TrafficSituation) -> TrafficSituation: """ Convert situation data which is given in SI units to maritime units. - Params: - * situation: Traffic situation data + Parameters + ---------- + situation : TrafficSituation + Traffic situation data Returns ------- - * situation: Converted traffic situation data + situation : TrafficSituation + Converted traffic situation data """ assert situation.own_ship is not None situation.own_ship = convert_ship_data_from_si_units_to_maritime(situation.own_ship) assert situation.target_ships is not None for target_ship in situation.target_ships: - target_ship = convert_ship_data_from_si_units_to_maritime(target_ship) + target_ship = convert_ship_data_from_si_units_to_maritime(target_ship) # noqa: PLW2901 return situation @@ -56,30 +72,41 @@ def 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. - Params: - * ship: Ship data + Parameters + ---------- + ship : T_ship + Ship data Returns ------- - * ship: Converted ship data + ship : T_ship + Converted ship data """ assert ship.initial is not None - ship.initial.position.longitude = round(rad_2_deg(ship.initial.position.longitude), 8) - ship.initial.position.latitude = round(rad_2_deg(ship.initial.position.latitude), 8) + assert ship.initial.heading is not None + ship.initial.position.lon = round(rad_2_deg(ship.initial.position.lon), 8) + ship.initial.position.lat = round(rad_2_deg(ship.initial.position.lat), 8) ship.initial.cog = round(rad_2_deg(ship.initial.cog), 2) ship.initial.sog = round(m_pr_s_2_knot(ship.initial.sog), 1) ship.initial.heading = round(rad_2_deg(ship.initial.heading), 2) if ship.waypoints is not None: for waypoint in ship.waypoints: - waypoint.position.latitude = round(rad_2_deg(waypoint.position.latitude), 8) - waypoint.position.longitude = round(rad_2_deg(waypoint.position.longitude), 8) - if not waypoint.data: - continue - assert waypoint.data.model_extra - if waypoint.data.model_extra.get("sog") is not None: - waypoint.data.model_extra["sog"]["value"] = round(m_pr_s_2_knot(waypoint.data.model_extra["sog"]["value"]), 1) # type: ignore - if waypoint.data.model_extra.get("heading") is not None: - waypoint.data.model_extra["heading"]["value"] = round(m_pr_s_2_knot(waypoint.data.model_extra["heading"]["value"]), 2) # type: ignore + waypoint.position.lat = round(rad_2_deg(waypoint.position.lat), 8) + waypoint.position.lon = round(rad_2_deg(waypoint.position.lon), 8) + if waypoint.turn_radius is not None: + waypoint.turn_radius = round(m_2_nm(waypoint.turn_radius), 2) + if waypoint.leg is not None: + if waypoint.leg.starboard_xtd is not None: + waypoint.leg.starboard_xtd = round(m_2_nm(waypoint.leg.starboard_xtd), 2) + if waypoint.leg.portside_xtd is not None: + waypoint.leg.portside_xtd = round(m_2_nm(waypoint.leg.portside_xtd), 2) + if waypoint.leg.data is not None and waypoint.leg.data.sog is not None: + assert waypoint.leg.data.sog.value is not None + assert waypoint.leg.data.sog.interp_start is not None + assert waypoint.leg.data.sog.interp_end is not None + waypoint.leg.data.sog.value = round(m_pr_s_2_knot(waypoint.leg.data.sog.value), 2) + waypoint.leg.data.sog.interp_start = round(m_2_nm(waypoint.leg.data.sog.interp_start), 2) + waypoint.leg.data.sog.interp_end = round(m_2_nm(waypoint.leg.data.sog.interp_end), 2) return ship diff --git a/tests/conftest.py b/tests/conftest.py index 88031e3..e5a21bf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- """Root level fixtures for `trafficgen`""" + from pathlib import Path import pytest -from pytest import TempPathFactory @pytest.fixture @@ -12,7 +11,7 @@ def your_fixture(): See more at: http://doc.pytest.org/en/latest/fixture.html """ - return None + return @pytest.fixture(scope="session") @@ -99,7 +98,7 @@ def own_ship_file(proj_data_folder: Path) -> Path: return Path(proj_data_folder) / "own_ship" / "own_ship.json" -@pytest.fixture(scope="function") -def output_folder(tmp_path_factory: TempPathFactory) -> Path: +@pytest.fixture +def output_folder(tmp_path_factory: pytest.TempPathFactory) -> Path: """Path to temporary data folder used to write output files to in a test""" return tmp_path_factory.mktemp("output_", numbered=True) diff --git a/tests/data/test_01/test_01_1.json b/tests/data/test_01/test_01_1.json index 7e76eb4..c795629 100644 --- a/tests/data/test_01/test_01_1.json +++ b/tests/data/test_01/test_01_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 270.0, @@ -20,4 +20,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_01/test_01_2.json b/tests/data/test_01/test_01_2.json index 9cd1eff..385d5a0 100644 --- a/tests/data/test_01/test_01_2.json +++ b/tests/data/test_01/test_01_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 12.0, "cog": 0.0, @@ -20,4 +20,4 @@ "vectorTime": 25.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_01/test_01_3.json b/tests/data/test_01/test_01_3.json index 47540a5..5a0423b 100644 --- a/tests/data/test_01/test_01_3.json +++ b/tests/data/test_01/test_01_3.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 110.0, @@ -20,4 +20,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_01/test_01_4.json b/tests/data/test_01/test_01_4.json index 1126787..c283d30 100644 --- a/tests/data/test_01/test_01_4.json +++ b/tests/data/test_01/test_01_4.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -20,4 +20,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_01/test_01_5.json b/tests/data/test_01/test_01_5.json index 929e2cd..be62724 100644 --- a/tests/data/test_01/test_01_5.json +++ b/tests/data/test_01/test_01_5.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 11.0, "cog": 45.0, @@ -20,4 +20,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_02/test_02_1.json b/tests/data/test_02/test_02_1.json index 6730018..283f702 100644 --- a/tests/data/test_02/test_02_1.json +++ b/tests/data/test_02/test_02_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 270.0, @@ -19,4 +19,4 @@ "vectorTime": 15.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_02/test_02_2.json b/tests/data/test_02/test_02_2.json index b44a6e5..5168cad 100644 --- a/tests/data/test_02/test_02_2.json +++ b/tests/data/test_02/test_02_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -19,4 +19,4 @@ "relativeSpeed": 0.6 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_03/test_03_1.json b/tests/data/test_03/test_03_1.json index 4d10903..31765e1 100644 --- a/tests/data/test_03/test_03_1.json +++ b/tests/data/test_03/test_03_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -18,4 +18,4 @@ "desiredEncounterType": "overtaking-give-way" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_03/test_03_2.json b/tests/data/test_03/test_03_2.json index 286ad87..2bef70d 100644 --- a/tests/data/test_03/test_03_2.json +++ b/tests/data/test_03/test_03_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 12.0, "cog": 230.0, @@ -18,4 +18,4 @@ "desiredEncounterType": "crossing-stand-on" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_04/test_04_1.json b/tests/data/test_04/test_04_1.json index 1390687..fb264c0 100644 --- a/tests/data/test_04/test_04_1.json +++ b/tests/data/test_04/test_04_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -22,4 +22,4 @@ "desiredEncounterType": "head-on" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_05/test_05_1.json b/tests/data/test_05/test_05_1.json index fb6788e..c773518 100644 --- a/tests/data/test_05/test_05_1.json +++ b/tests/data/test_05/test_05_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -19,4 +19,4 @@ "desiredEncounterType": "crossing-give-way" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_05/test_05_2.json b/tests/data/test_05/test_05_2.json index b141aa8..26948fd 100644 --- a/tests/data/test_05/test_05_2.json +++ b/tests/data/test_05/test_05_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -22,4 +22,4 @@ "desiredEncounterType": "overtaking-give-way" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_05/test_05_3.json b/tests/data/test_05/test_05_3.json index c6752e4..8f6004c 100644 --- a/tests/data/test_05/test_05_3.json +++ b/tests/data/test_05/test_05_3.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 270.0, @@ -24,4 +24,4 @@ "desiredEncounterType": "head-on" } ] -} \ No newline at end of file +} diff --git a/tests/data/test_06/test_06_1.json b/tests/data/test_06/test_06_1.json index 6fb6bde..7e0d30c 100644 --- a/tests/data/test_06/test_06_1.json +++ b/tests/data/test_06/test_06_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -26,4 +26,4 @@ "vectorTime": 15.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_06/test_06_2.json b/tests/data/test_06/test_06_2.json index 9df0882..505dbe8 100644 --- a/tests/data/test_06/test_06_2.json +++ b/tests/data/test_06/test_06_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -20,4 +20,4 @@ "vectorTime": 20.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_07/test_07_1.json b/tests/data/test_07/test_07_1.json index f60c8ed..f7207a6 100644 --- a/tests/data/test_07/test_07_1.json +++ b/tests/data/test_07/test_07_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 10.0, "cog": 270.0, @@ -19,4 +19,4 @@ "beta": 7.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_07/test_07_2.json b/tests/data/test_07/test_07_2.json index 54959ce..089e374 100644 --- a/tests/data/test_07/test_07_2.json +++ b/tests/data/test_07/test_07_2.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -19,4 +19,4 @@ "beta": 90.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_07/test_07_3.json b/tests/data/test_07/test_07_3.json index fe3c978..7109263 100644 --- a/tests/data/test_07/test_07_3.json +++ b/tests/data/test_07/test_07_3.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 110.0, @@ -19,4 +19,4 @@ "beta": -12.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_07/test_07_4.json b/tests/data/test_07/test_07_4.json index a40c518..ab79c35 100644 --- a/tests/data/test_07/test_07_4.json +++ b/tests/data/test_07/test_07_4.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, @@ -19,4 +19,4 @@ "beta": 320.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_07/test_07_5.json b/tests/data/test_07/test_07_5.json index f0ecbf3..119f15d 100644 --- a/tests/data/test_07/test_07_5.json +++ b/tests/data/test_07/test_07_5.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 11.0, "cog": 45.0, @@ -19,4 +19,4 @@ "beta": 15.0 } ] -} \ No newline at end of file +} diff --git a/tests/data/test_08/test_08_1.json b/tests/data/test_08/test_08_1.json index 50b6e73..4f520af 100644 --- a/tests/data/test_08/test_08_1.json +++ b/tests/data/test_08/test_08_1.json @@ -4,8 +4,8 @@ "ownShip": { "initial": { "position": { - "latitude": 58.763449, - "longitude": 10.490654 + "lat": 58.763449, + "lon": 10.490654 }, "sog": 8.0, "cog": 0.0, diff --git a/tests/test_read_files.py b/tests/test_read_files.py index b4ddb93..33afa39 100644 --- a/tests/test_read_files.py +++ b/tests/test_read_files.py @@ -1,12 +1,6 @@ """Tests reading files.""" from pathlib import Path -from typing import List, Set - -from maritime_schema.types.caga import ( - GeneralShipType, - ShipStatic, -) from trafficgen.read_files import ( read_encounter_settings_file, @@ -14,7 +8,13 @@ read_situation_files, read_target_ship_static_files, ) -from trafficgen.types import EncounterSettings, EncounterType, SituationInput +from trafficgen.types import ( + AisShipType, + EncounterSettings, + EncounterType, + ShipStatic, + SituationInput, +) def test_read_situations_1_ts_full_spec(situations_folder_test_01: Path): @@ -22,7 +22,7 @@ def test_read_situations_1_ts_full_spec(situations_folder_test_01: Path): Test reading traffic situations with full specification, meaning all parameters are specified. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_01) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_01) assert len(desired_traffic_situations) == 5 # sourcery skip: no-loop-in-tests @@ -44,7 +44,7 @@ def test_read_situations_1_ts_partly_spec(situations_folder_test_02: Path): Test reading traffic situations using partly specification, meaning some of the parameters are specified. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_02) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_02) assert len(desired_traffic_situations) == 2 # sourcery skip: no-loop-in-tests @@ -61,7 +61,7 @@ def test_read_situations_1_ts_minimum_spec(situations_folder_test_03: Path): Test reading traffic situations using using minimum specification, meaning only type of situation is specified. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_03) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_03) assert len(desired_traffic_situations) == 2 # sourcery skip: no-loop-in-tests @@ -79,7 +79,7 @@ def test_read_situations_2_ts_one_to_many_situations(situations_folder_test_04: """ Test reading a traffic situation file num_situations=5 and 2 encounter specifications. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_04) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_04) assert len(desired_traffic_situations) == 1 # sourcery skip: no-loop-in-tests @@ -99,11 +99,11 @@ def test_read_situations_one_to_many_situations(situations_folder_test_05: Path) """ Test reading three traffic situation files 1, 2 and 3 encounter specifications. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_05) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_05) assert len(desired_traffic_situations) == 3 # sourcery skip: no-loop-in-tests - num_situations_values_found: Set[int] = set() + num_situations_values_found: set[int] = set() for situation in desired_traffic_situations: assert situation.own_ship is not None assert situation.encounters is not None @@ -122,11 +122,11 @@ def test_read_situations_with_different_encounter_types(situations_folder_test_0 """ Test reading 5 traffic situation files with different encounter types. """ - desired_traffic_situations: List[SituationInput] = read_situation_files(situations_folder_test_07) + desired_traffic_situations: list[SituationInput] = read_situation_files(situations_folder_test_07) assert len(desired_traffic_situations) == 5 # sourcery skip: no-loop-in-tests - desired_encounter_types_found: Set[EncounterType] = set() + desired_encounter_types_found: set[EncounterType] = set() for situation in desired_traffic_situations: assert situation.own_ship is not None assert situation.encounters is not None @@ -152,24 +152,26 @@ def test_read_own_ship(own_ship_file: Path): Test reading own ship file. """ own_ship_static: ShipStatic = read_own_ship_static_file(own_ship_file) - assert own_ship_static.length is not None - assert own_ship_static.width is not None - assert own_ship_static.speed_max is not None + assert own_ship_static.dimensions is not None + assert own_ship_static.dimensions.length is not None + assert own_ship_static.dimensions.width is not None + assert own_ship_static.sog_max is not None assert own_ship_static.mmsi is not None - assert own_ship_static.ship_type is GeneralShipType.PASSENGER + assert own_ship_static.ship_type is AisShipType.PASSENGER def test_read_target_ships(target_ships_folder: Path): """ Test reading target ship files. """ - target_ships_static: List[ShipStatic] = read_target_ship_static_files(target_ships_folder) + target_ships_static: list[ShipStatic] = read_target_ship_static_files(target_ships_folder) # sourcery skip: no-loop-in-tests for target_ship_static in target_ships_static: - assert target_ship_static.length is not None - assert target_ship_static.width is not None - assert target_ship_static.speed_max is not None + assert target_ship_static.dimensions is not None + assert target_ship_static.dimensions.length is not None + assert target_ship_static.dimensions.width is not None + assert target_ship_static.sog_max is not None def test_read_encounter_settings_file(settings_file: Path): diff --git a/tests/test_trafficgen.py b/tests/test_trafficgen.py index 18da62a..c3bc85c 100644 --- a/tests/test_trafficgen.py +++ b/tests/test_trafficgen.py @@ -1,13 +1,10 @@ """Tests for `trafficgen` package.""" from pathlib import Path -from typing import List +from typing import TYPE_CHECKING import pytest from click.testing import CliRunner -from maritime_schema.types.caga import ( - TrafficSituation, -) from trafficgen import cli from trafficgen.read_files import ( @@ -15,6 +12,11 @@ ) from trafficgen.ship_traffic_generator import generate_traffic_situations +if TYPE_CHECKING: + from trafficgen.types import ( + TrafficSituation, + ) + @pytest.fixture def response(): @@ -22,7 +24,7 @@ def response(): See more at: http://doc.pytest.org/en/latest/fixture.html """ - return None + return def test_content(response: None): @@ -38,7 +40,8 @@ def test_basic_cli(): assert "Usage:" in result.output help_result = runner.invoke(cli.main, ["--help"]) assert help_result.exit_code == 0 - assert "--help" in help_result.output and "Show this message and exit" in help_result.output + assert "--help" in help_result.output + assert "Show this message and exit" in help_result.output def test_gen_situations_cli( @@ -79,7 +82,7 @@ def test_gen_situations( settings_file: Path, ): """Test generating traffic situations.""" - situations: List[TrafficSituation] = generate_traffic_situations( + situations: list[TrafficSituation] = generate_traffic_situations( situation_folder=situations_folder, own_ship_file=own_ship_file, target_ship_folder=target_ships_folder, @@ -121,7 +124,7 @@ def test_gen_situations_1_ts_full_spec_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 5 # sourcery skip: no-loop-in-tests @@ -163,7 +166,7 @@ def test_gen_situations_1_ts_partly_spec_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 2 # sourcery skip: no-loop-in-tests @@ -216,7 +219,7 @@ def test_gen_situations_1_ts_minimum_spec_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 2 # sourcery skip: no-loop-in-tests @@ -257,7 +260,7 @@ def test_gen_situations_2_ts_one_to_many_situations_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 5 # sourcery skip: no-loop-in-tests @@ -298,7 +301,7 @@ def test_gen_situations_one_to_many_situations_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 10 # sourcery skip: no-loop-in-tests @@ -340,7 +343,7 @@ def test_gen_situations_ot_gw_target_ship_speed_too_high_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 3 # sourcery skip: no-loop-in-tests @@ -382,7 +385,7 @@ def test_gen_situations_illegal_beta_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) # sourcery skip: no-loop-in-tests for situation in situations: @@ -421,7 +424,7 @@ def test_gen_situation_beta_limited_cli( assert result.exit_code == 0 assert "Generating traffic situations" in result.output - situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == 1 # sourcery skip: no-loop-in-tests diff --git a/tests/test_write_files.py b/tests/test_write_files.py index c992355..b68fcca 100644 --- a/tests/test_write_files.py +++ b/tests/test_write_files.py @@ -1,11 +1,7 @@ """Tests writing files.""" from pathlib import Path -from typing import List - -from maritime_schema.types.caga import ( - TrafficSituation, -) +from typing import TYPE_CHECKING from trafficgen.read_files import ( read_generated_situation_files, @@ -13,6 +9,11 @@ from trafficgen.ship_traffic_generator import generate_traffic_situations from trafficgen.write_traffic_situation_to_file import write_traffic_situations_to_json_file +if TYPE_CHECKING: + from trafficgen.types import ( + TrafficSituation, + ) + def test_write_situations_multiple( situations_folder: Path, @@ -23,14 +24,14 @@ def test_write_situations_multiple( ): """Test writing multiple traffic situations in one call.""" - situations: List[TrafficSituation] = generate_traffic_situations( + situations: list[TrafficSituation] = generate_traffic_situations( situation_folder=situations_folder, own_ship_file=own_ship_file, target_ship_folder=target_ships_folder, settings_file=settings_file, ) write_traffic_situations_to_json_file(situations, output_folder) - reread_situations: List[TrafficSituation] = read_generated_situation_files(output_folder) + reread_situations: list[TrafficSituation] = read_generated_situation_files(output_folder) assert len(situations) == len(reread_situations) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 7b2670f..0000000 --- a/tox.ini +++ /dev/null @@ -1,27 +0,0 @@ -[tox] -isolated_build = True -envlist = py{39,310,311}-{linux,macos,windows} - - -[testenv] -system_site_packages = True -deps = - pytest>=7.4 - pytest-cov>=4.1 -commands = - pytest --cov --cov-config tox.ini {tty:--color=yes} {posargs} - - -[coverage:run] -source = trafficgen -branch = True - -[coverage:report] -fail_under = 10.0 -show_missing = True -skip_covered = True - -[coverage:paths] -source = - src/trafficgen - */site-packages/trafficgen