| Name | trafficgen JSON |
| Version |
0.8.2
JSON |
| download |
| home_page | None |
| Summary | Automatic generation of ship traffic situations from a set of predefined situations |
| upload_time | 2025-10-06 06:15:25 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | <3.13,>=3.11 |
| license | MIT License
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
| keywords |
simulation
testing
traffic generator
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Traffic Generator
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 paper is written describing the background for the tool and how it works <a href="./docs/source/ICMASS23_verfying_caga_systems.pdf" target="_blank">[paper]</a>
For package documentation, see [https://dnv-opensource.github.io/ship-traffic-generator/](https://dnv-opensource.github.io/ship-traffic-generator/)
## 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.
You can check your installation by running:
```sh
uv run trafficgen --help
```
## Usage
For simplest usage, clone this repo, then run ```pip install -e .``` (you may want to do this in a local environment, such as a venv, see an example with `uv` below).
Then run: ```trafficgen gen-situation```. You can add the option `-v` for visualization.
For further explanations, see the [documentation pages](https://dnv-opensource.github.io/ship-traffic-generator/) of the Ship Traffic Generator.
## 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: <br>
..on Windows:
```sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
..on MacOS and Linux:
```sh
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.)
Once installed, you can update `uv` to its latest version, anytime, by running:
```sh
uv self update
```
### Install Python
The traffic generator requires Python 3.11 or later. <br>
If you don't already have a compatible version installed on your machine, you way install Python through `uv`:
```sh
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.
> **Note**: you can also do this after you clone the repo, see below.
Alternatively, and if you want a standalone version of Python on your machine, you can install Python either via `winget`:
```sh
winget install --id Python.Python
```
or you can download and install Python from the [python.org](https://www.python.org/downloads/) website.
### 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
```
### Install dependencies
Run `uv sync -U` to create a virtual environment and install all project dependencies into it:
```sh
uv sync -U
```
> **Note**: Using `--no-dev` will omit installing development dependencies.
> **Note**: You can also define the python environment at the same time, by running for example ```uv sync -U -p 3.12``` to install Python 3.12.
> **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`.
### (Optional) Activate the virtual environment
When using `uv`, there is in almost all cases no longer a need to manually activate the virtual environment. <br>
`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
uv run <command>
```
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: <br>
..on Windows:
```sh
.venv\Scripts\activate.bat
```
> **Note**: If you use the cmd terminal in VS Code, it will show this activated venv as (trafficgen) at the start of every line command.
..on Linux:
```sh
source .venv/bin/activate
```
### Install the package
```sh
uv pip install -e .
```
### Test the install
```sh
pytest .
```
### Documentation
For pre-generated package documentation, see [https://dnv-opensource.github.io/ship-traffic-generator/](https://dnv-opensource.github.io/ship-traffic-generator/)
To generate documentation from the source code, use:
```sh
uv run docs/make.bat html
```
The html documentation will then be available in `docs/build/html/index.html`
### Testing PRs
1. Check out the PR branch
1. Update dependencies, re-install latest package, and run tests (ensure all pass):
```sh
.venv\Scripts\activate.bat
uv self update
uv sync -U
uv pip install -e .
pytest .
```
1. Run any additional tests you want / care about / related to PR topic, e.g.:
```sh
trafficgen gen-situation -o test_output
```
and make edits to config or change this command to test new functionalities.
Raw data
{
"_id": null,
"home_page": null,
"name": "trafficgen",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.11",
"maintainer_email": null,
"keywords": "simulation, testing, traffic generator",
"author": null,
"author_email": "Tom Arne Pedersen <Tom.Arne.Pedersen@dnv.com>, Claas Rostock <Claas.Rostock@dnv.com>, Minos Hemrich <Minos.Hemrich@dnv.com>",
"download_url": "https://files.pythonhosted.org/packages/8e/54/b5ad950709f2ca736413ce602f48fe703409bdafbcf459197631b31107f6/trafficgen-0.8.2.tar.gz",
"platform": null,
"description": "# Traffic Generator\n\nThe tool generates a structured set of encounters for verifying automatic collision and grounding avoidance systems.\nBased on input parameters such as desired situation, relative speed, relative bearing etc,\nthe tool will generate a set of traffic situations. The traffic situations may be written to files and/or inspected using plots.\n\nA paper is written describing the background for the tool and how it works <a href=\"./docs/source/ICMASS23_verfying_caga_systems.pdf\" target=\"_blank\">[paper]</a>\n\nFor package documentation, see [https://dnv-opensource.github.io/ship-traffic-generator/](https://dnv-opensource.github.io/ship-traffic-generator/)\n\n## Installation\n\nTo install Ship Traffic Generator, run this command in your terminal:\n\n```sh\npip install trafficgen\n```\n\nThis is the preferred method to install Traffic Generator, as it will always install the most recent stable release.\n\nYou can check your installation by running:\n\n```sh\nuv run trafficgen --help\n```\n\n## Usage\n\nFor simplest usage, clone this repo, then run ```pip install -e .``` (you may want to do this in a local environment, such as a venv, see an example with `uv` below).\n\nThen run: ```trafficgen gen-situation```. You can add the option `-v` for visualization.\n\nFor further explanations, see the [documentation pages](https://dnv-opensource.github.io/ship-traffic-generator/) of the Ship Traffic Generator.\n\n## Development Setup\n\n### Install UV\n\nThis project uses `uv` as package manager.\nIf 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: <br>\n..on Windows:\n\n```sh\npowershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n```\n\n..on MacOS and Linux:\n\n```sh\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n(see [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/) for all / alternative installation methods.)\n\nOnce installed, you can update `uv` to its latest version, anytime, by running:\n\n```sh\nuv self update\n```\n\n### Install Python\n\nThe traffic generator requires Python 3.11 or later. <br>\n\nIf you don't already have a compatible version installed on your machine, you way install Python through `uv`:\n\n```sh\nuv python install\n```\n\nThis will install the latest stable version of Python into the uv Python directory, i.e. as a uv-managed version of Python.\n> **Note**: you can also do this after you clone the repo, see below.\n\nAlternatively, and if you want a standalone version of Python on your machine, you can install Python either via `winget`:\n\n```sh\nwinget install --id Python.Python\n```\n\nor you can download and install Python from the [python.org](https://www.python.org/downloads/) website.\n\n### Clone the repository\n\nClone the traffig generator repository into your local development directory:\n\n```sh\ngit clone https://github.com/dnv-opensource/ship-traffic-generator path/to/your/dir/ship-traffic-generator\n```\n\nChange into the project directory after cloning:\n\n```sh\ncd ship-traffic-generator\n```\n\n### Install dependencies\n\nRun `uv sync -U` to create a virtual environment and install all project dependencies into it:\n\n```sh\nuv sync -U\n```\n\n> **Note**: Using `--no-dev` will omit installing development dependencies.\n\n> **Note**: You can also define the python environment at the same time, by running for example ```uv sync -U -p 3.12``` to install Python 3.12.\n\n> **Note**: `uv` will create a new virtual environment called `.venv` in the project root directory when running\n> `uv sync` the first time. Optionally, you can create your own virtual environment using e.g. `uv venv`, before running\n> `uv sync`.\n\n### (Optional) Activate the virtual environment\n\nWhen using `uv`, there is in almost all cases no longer a need to manually activate the virtual environment. <br>\n`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:\n\n```sh\nuv run <command>\n```\n\nHowever, you still _can_ manually activate the virtual environment if needed.\nWhen developing in an IDE, for instance, this can in some cases be necessary depending on your IDE settings.\nTo manually activate the virtual environment, run one of the \"known\" legacy commands: <br>\n..on Windows:\n\n```sh\n.venv\\Scripts\\activate.bat\n```\n\n> **Note**: If you use the cmd terminal in VS Code, it will show this activated venv as (trafficgen) at the start of every line command.\n\n..on Linux:\n\n```sh\nsource .venv/bin/activate\n```\n\n### Install the package\n\n```sh\nuv pip install -e .\n```\n\n### Test the install\n\n```sh\npytest .\n```\n\n### Documentation\n\nFor pre-generated package documentation, see [https://dnv-opensource.github.io/ship-traffic-generator/](https://dnv-opensource.github.io/ship-traffic-generator/)\n\nTo generate documentation from the source code, use:\n\n```sh\nuv run docs/make.bat html\n```\n\nThe html documentation will then be available in `docs/build/html/index.html`\n\n### Testing PRs\n\n1. Check out the PR branch\n\n1. Update dependencies, re-install latest package, and run tests (ensure all pass):\n\n ```sh\n .venv\\Scripts\\activate.bat\n uv self update\n uv sync -U\n uv pip install -e .\n pytest .\n ```\n\n1. Run any additional tests you want / care about / related to PR topic, e.g.:\n\n ```sh\n trafficgen gen-situation -o test_output\n ```\n\n and make edits to config or change this command to test new functionalities.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource)\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Automatic generation of ship traffic situations from a set of predefined situations",
"version": "0.8.2",
"project_urls": {
"Changelog": "https://github.com/dnv-innersource/ship-traffic-generator/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/dnv-opensource/ship-traffic-generator",
"Issues": "https://github.com/dnv-opensource/ship-traffic-generator/issues",
"Repository": "https://github.com/dnv-opensource/ship-traffic-generator.git"
},
"split_keywords": [
"simulation",
" testing",
" traffic generator"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a02e087cdab7f02e0623890a198821d58121a6972d953ee3fe659e67a4f38eaa",
"md5": "6335ff0846364e22a8642b67b1b77f6d",
"sha256": "bf1f229ffacfb8334f2be5dd24537139fd5797543c6cd6901dabbf19f42971f5"
},
"downloads": -1,
"filename": "trafficgen-0.8.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6335ff0846364e22a8642b67b1b77f6d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.11",
"size": 5254,
"upload_time": "2025-10-06T06:15:24",
"upload_time_iso_8601": "2025-10-06T06:15:24.225420Z",
"url": "https://files.pythonhosted.org/packages/a0/2e/087cdab7f02e0623890a198821d58121a6972d953ee3fe659e67a4f38eaa/trafficgen-0.8.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8e54b5ad950709f2ca736413ce602f48fe703409bdafbcf459197631b31107f6",
"md5": "f842810a78cd61509dfd5e15a6a9d8af",
"sha256": "0f33c6ea2763b00f2fdda19ef7085533d49a5abb3085636557d4ff06f94293de"
},
"downloads": -1,
"filename": "trafficgen-0.8.2.tar.gz",
"has_sig": false,
"md5_digest": "f842810a78cd61509dfd5e15a6a9d8af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.11",
"size": 98158,
"upload_time": "2025-10-06T06:15:25",
"upload_time_iso_8601": "2025-10-06T06:15:25.302351Z",
"url": "https://files.pythonhosted.org/packages/8e/54/b5ad950709f2ca736413ce602f48fe703409bdafbcf459197631b31107f6/trafficgen-0.8.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-06 06:15:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dnv-innersource",
"github_project": "ship-traffic-generator",
"github_not_found": true,
"lcname": "trafficgen"
}