Skip to content

Commit ee3f83d

Browse files
Merge pull request #72 from dnv-opensource/71-add-example-output-to-documentation
Add documentation on output files (new page), add links to maritime schema, add links to input/output file pages from usage page.
2 parents 5ea7fbc + 1d281e5 commit ee3f83d

4 files changed

Lines changed: 122 additions & 3 deletions

File tree

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Ship Traffic Generator Documentation
1313
README
1414
usage
1515
input_files
16+
output_files
1617
api
1718
CHANGELOG
1819
STYLEGUIDE

docs/source/input_files.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. _input_files:
12
===========
23
Input files
34
===========

docs/source/output_files.rst

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
.. _output_files:
2+
===========
3+
Output files
4+
===========
5+
6+
The Ship Traffic Generator creates output files according to
7+
the open-source `maritime schema`_ `Traffic Situation`_ format.
8+
9+
.. _maritime schema: https://dnv-opensource.github.io/maritime-schema/
10+
.. _Traffic Situation: https://dnv-opensource.github.io/maritime-schema/traffic_situation/
11+
12+
Below is one example of an output file created by the Ship Traffic Generator.
13+
This describes the starting position of the ownship (ship under test)
14+
and one target ship, and their planned goal positions, for a head-on (HO) encounter.
15+
Note that the first waypoint is typically set to the initial waypoint.
16+
The `targetShips` field can contain multiple target ships,
17+
at different COLREG encounter courses.
18+
19+
Example 1: Output file generated by the Ship Traffic Generator::
20+
21+
{
22+
"version": "0.8.1",
23+
"title": "HO",
24+
"description": "A head on situation with one target ship.",
25+
"ownShip": {
26+
"initial": {
27+
"position": {
28+
"lon": 10.490654,
29+
"lat": 58.763449
30+
},
31+
"sog": 10.0,
32+
"cog": 0.0,
33+
"heading": 0.0,
34+
"navStatus": "Under way using engine"
35+
},
36+
"waypoints": [
37+
{
38+
"position": {
39+
"lon": 10.490654,
40+
"lat": 58.763449
41+
}
42+
},
43+
{
44+
"position": {
45+
"lon": 10.490654,
46+
"lat": 58.8465724
47+
}
48+
}
49+
],
50+
"static": {
51+
"id": 0,
52+
"mmsi": 257847600,
53+
"name": "BASTO VI",
54+
"dimensions": {
55+
"length": 122.0,
56+
"width": 20.0,
57+
"height": 8.0,
58+
"a": 61.0,
59+
"b": 61.0,
60+
"c": 10.0,
61+
"d": 10.0
62+
},
63+
"shipType": "Passenger"
64+
}
65+
},
66+
"targetShips": [
67+
{
68+
"initial": {
69+
"position": {
70+
"lon": 10.49680582,
71+
"lat": 58.85500037
72+
},
73+
"sog": 12.1,
74+
"cog": 183.63,
75+
"heading": 183.63,
76+
"navStatus": "Under way using engine"
77+
},
78+
"waypoints": [
79+
{
80+
"position": {
81+
"lon": 10.49680582,
82+
"lat": 58.85500037
83+
}
84+
},
85+
{
86+
"position": {
87+
"lon": 10.48458595,
88+
"lat": 58.75501409
89+
}
90+
}
91+
],
92+
"static": {
93+
"id": 10,
94+
"name": "target_ship_1",
95+
"dimensions": {
96+
"length": 122.0,
97+
"width": 20.0,
98+
"height": 8.0,
99+
"a": 61.0,
100+
"b": 61.0,
101+
"c": 10.0,
102+
"d": 10.0
103+
},
104+
"shipType": "Passenger"
105+
}
106+
}
107+
]
108+
}

docs/source/usage.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,26 @@ Example::
2626

2727
trafficgen gen-situation -s ./data/example_situations_input -o ./data/test_output
2828

29-
Situations
29+
Input situations
3030
~~~~~~~~~~
3131
When generating situations without specifying where the desired situations (``--situation``) are found, the
3232
default path, which is ``default=./baseline_situations_input/``, will be used.
33+
For more information on input files, see :ref:`input_files`.
3334

3435
Baseline situations
3536
~~~~~~~~~~~~~~~~~~~
3637
The baseline situations are a set of generic traffic situations covering head-on, overtaking stand-on/give-way
3738
and crossing stand-on/give-way encounters. To cover the combination of encounters for 1, 2 and 3 target ships,
38-
there are in total 55 baseline situations. The input files for generating these situations are found in
39-
``./baseline_situations_input/``
39+
there are in total 55 baseline situations.
40+
41+
The input files for generating these situations are found in ``./baseline_situations_input/``
42+
43+
The generated output files for these situations are found in ``./baseline_situations_generated/``
44+
45+
Output situations
46+
~~~~~~~~~~~~~~~~~
47+
The generated traffic situations are saved in the specified output folder (``--output``).
48+
For more information on output files, see :ref:`output_files`.
4049

4150
Plotting
4251
~~~~~~~~

0 commit comments

Comments
 (0)