Commit efa49df8 authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

feat(EndtoEndTests): Spawner testcases


Also-by: Reinhard Biegel's avatarReinhard Biegel <reinhard.biegel@in-tech.com>
Signed-off-by: David Weiß's avatarWeiss David <david.weiss@in-tech.com>
parent f3408193
..
*******************************************************************************
Copyright (c) 2021 in-tech GmbH
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
SPDX-License-Identifier: EPL-2.0
*******************************************************************************
.. _spawner_features:
****************
Spawner Features
****************
.. _spawner_features_prerun:
PreRunSpawner
=============
Spawning on roads, lanes and ranges
-----------------------------------
Non-existent roads
^^^^^^^^^^^^^^^^^^
Requirement
Road IDs specified in the configuration, but not part of the scenery file are igored.
Verified by
Unit Test SpawnerPreRunCommonParameterExtractor_GetWayToNextRoad_NoPossibleWay
.. _spawner_features_prerun_on_roads_single_road:
Single road
^^^^^^^^^^^
Requirement
Spawning on the given road takes place.
Requirement
No agents are spawned on other roads in the scenery.
Verified by
End-to-end Test SpawnerPreRun_Highway_SingleRoad
.. _spawner_features_prerun_on_roads_consecutive_roads:
Consecutive roads
^^^^^^^^^^^^^^^^^
Precondition
Spawner configuration specifies a list of consecutively connected roads in a single ListItem.
Requirement
Spawning on the given roads takes place.
Requirement
No agents spawned on other roads in the scenery.
Requirement
Agents are spawned on all drivable lanes (which are part of the roads being specified in the configuration).
Requirement
Agents are spawned in the correct driving direction.
Verified by
End-to-end Test SpawnerPreRun_Highway_FullStream
End-to-end Test SpawnerPreRun_SingleRoad_DrivingDirection
Non-consecutive roads
^^^^^^^^^^^^^^^^^^^^^
Precondition
Spawner configuration specifies a list of non-consecutively connected roads.
Requirement
Spawning on the given roads takes place.
Requirement
Missing roads between the specified ones are automatically determined by the Spawner and handled like they were specified in the configuration in the first place.
The resulting path being spawned on is arbitrary if multiple solutions exist for a scenery, but only one path shall be used.
Verified by
Covered by :ref:`spawner_features_prerun_on_roads_across_junction`
.. _spawner_features_prerun_on_roads_across_junction:
Roads across junction
^^^^^^^^^^^^^^^^^^^^^
Precondition
Spawner configuration specifies a list of (not necessarily consecutively) connected roads in a single ListItem.
Precondition
The chain of roads specified has to cross a single junction.
Requirement
Spawning on the given roads takes place.
Requirement
Missing roads between the specified ones are automatically determined by the Spawner and handled like they were specified in the configuration in the first place.
The resulting path being spawned on is arbitrary if multiple solutions exist for a scenery, but only one path shall be used.
Verified by
End-to-end Test SpawnerPreRun_Highway_EntryExit
Multiple roads (including non existent IDs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Spawner configuration specifies a list of (at least partially) consecutively connected roads in a single ListItem.
Precondition
At least one road id given in the configuration is not present in the scenery.
Requirement
Spawning on the given roads takes place up to the first non-existent road that is encountered.
Requirement
No spawning takes place, if the first road of the list doesn't exist.
Verified by
End-to-end Test SpawnerPreRun_Highway_IncorrectStreamBegin
End-to-end Test SpawnerPreRun_Highway_IncorrectStreamMid
Specified lanes
^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
A list of lanes to be spawned on is specified in the Spawner configuration.
Precondition
The list of lanes contains at least one lane IDs which exist for the first specified road.
Precondition
The list of lanes contains at least one lane IDs which doesn't exist for the first specified road.
Requirement
Spawning takes place on the specified lane IDs (on drivable lanes).
Requirement
Spawning does not take place on other lane IDs.
Requirement
Lane IDs not present for one or more roads do not lead to an error.
Verified by
End-to-end Test SpawnerPreRun_SingleRoad_SpecifiedLanes
Multiple overlapping road streams
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Two road streams are specified in the Spawner configuration (as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`).
Precondition
The two road streams have at least one road in common.
Precondition
The Spawner configuration specifies the lanes to spawn on in such a way that there are no overlapping lanes (on the road being common to both streams).
Requirement
Spawning on the given roads and all given lanes takes place.
Verified by
End-to-end Test SpawnerPreRun_Highway_RoadOverlap
Spawning on range (SStart + SEnd within road boundaries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
SStart and SEnd are set to values within the road boundaries (with the effective start s-coordinate being lower than the effective end s-coordinate when taking the whole road stream into account).
Requirement
Agents are spawned within the specified range.
Requirement
No agents are spawned outside of the specified range.
Verified by
Unit Test SpawnerPreRunCommonParameterExtractor_ExtractSpawnAreas_AllOptionalParameters
End-to-end Test SpawnerPreRun_SingleRoad_SpecifiedRange
Spawning on range (SStart + SLength within road boundaries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
SStart and SLength are set to values within the road boundaries (with the effective start s-coordinate being lower than the effective end s-coordinate when taking the whole road stream into account).
Requirement
Agents are spawned within the specified range.
Requirement
No agents are spawned outside of the specified range.
Verified by
Unit Test SpawnerPreRunCommonParameterExtractor_ExtractSpawnAreas_AllOptionalParameters
Spawning on range (SEnd outside of road boundaries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
SStart is set set to a value within the road boundaries, SEnd is set greater than the length of the last road given.
Requirement
Agents are spawned within the specified range.
Requirement
The specified range is capped to the length of the last road.
Verified by
Unit Test SpawnerPreRunCommonParameterExtractor_ExtractSpawnAreasWithSOutOfRange_ReturnsValidS
Spawning on range (SLength outside of road boundaries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
SStart is set set to a value within the road boundaries, SLength is set greater than the accumulated length of all roads given.
Requirement
Agents are spawned within the specified range.
Requirement
The specified range is capped to the length of the roads.
Verified by
Unit Test SpawnerPreRunCommonParameterExtractor_ExtractSpawnAreasWithSOutOfRange_ReturnsValidS
Right lane only
^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_consecutive_roads`.
Precondition
``RightLaneOnly`` set to ``true`` in the Spawner configuration.
Requirement
Spawning takes place on the specified roads.
Requirement
Spawning takes place on the rightmost lanes only.
Verified by
End-to-end Test SpawnerPreRun_SingleRoad_RightLaneOnly
Traffic parameters
------------------
Separation buffer specified
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_single_road`.
Precondition
``MinimumSeparationBuffer`` is set in the Spawner configuration.
Requirement
No two agents are spawned with a net distance lower than the specified separation buffer.
Verified by
UNTESTED
Separation buffer not specified
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_single_road`.
Precondition
``MinimumSeparationBuffer`` is not set in the Spawner configuration.
Requirement
No two agents are spawned with a net distance lower than 5 m.
Verified by
UNTESTED
Time to collision
^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_prerun_on_roads_single_road`.
Requirement
No agent is spawned with a TTC lower than the configured threshold (with respect to end of lane).
Verified by
UNTESTED
Also has to be checked by analysis of simulation output by an external tool
Stochastics
-----------
Traffic groups
^^^^^^^^^^^^^^
Requirement
The selection of traffic groups is randomized using a uniform distribution.
Verified by
UNTESTED
Agent profiles
^^^^^^^^^^^^^^
Requirement
The selection of agent profiles is randomized using a uniform distribution.
Verified by
UNTESTED
Velocity distribution
^^^^^^^^^^^^^^^^^^^^^
Requirement
The distribution of the velocities of a traffic group has to match the configured distribution.
Verified by
UNTESTED
Also has to be checked by analysis of simulation output by an external tool
TGap distribution
^^^^^^^^^^^^^^^^^
Requirement
The distribution of the TGaps of a traffic group has to match the configured distribution.
Verified by
UNTESTED
Also has to be checked by analysis of simulation output by an external tool
.. _spawner_features_runtime:
RuntimeSpawner
==============
Spawning on roads, lanes and ranges
-----------------------------------
Non-existent roads
^^^^^^^^^^^^^^^^^^
Requirement
Road IDs specified in the configuration, but not part of the scenery file are igored.
Verified by
UNTESTED
.. _spawner_features_runtime_on_roads_single_road:
Single road
^^^^^^^^^^^
Requirement
Spawning on the given road takes place.
Requirement
No agents are spawned on other roads in the scenery.
Requirement
Agents are spawned in the correct driving direction.
Verified by
End-to-end Test SpawnerRuntime_Highway_SingleRoad
Driving direction
^^^^^^^^^^^^^^^^^
Requirement
Agents are spawned in the correct driving direction (matching lane direction).
Verified by
End-to-end Test SpawnerRuntime_Highway_SingleRoad_DrivingDirection
Multiple roads (including non existent IDs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Spawner configuration specifies a list of roads in a single ListItem.
Precondition
At least one road id given in the configuration is not present in the scenery.
Requirement
Spawning on the given roads takes place.
Requirement
Non-existent road IDs are ignored.
Verified by
End-to-end Test SpawnerRuntime_Highway_MultipleRoads
Specified lanes
^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_runtime_on_roads_single_road`.
Precondition
A list of lanes to be spawned on is specified in the Spawner configuration.
Precondition
The list of lanes contains lane IDs which don't exist for the specified road.
Requirement
Spawning takes place on the specified lane IDs (on drivable lanes).
Requirement
Spawning does not take place on other lane IDs.
Requirement
Lane IDs not present for the specified road do not lead to an error.
Verified by
End-to-end Test SpawnerRuntime_SingleRoad_SpecifiedLanes
Right lane only
^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_runtime_on_roads_single_road`.
Precondition
``RightLaneOnly`` set to ``true`` in the Spawner configuration.
Requirement
Spawning takes place on the specified road.
Requirement
Spawning takes place on the rightmost lane only.
Verified by
End-to-end Test SpawnerRuntime_SingleRoad_RightLaneOnly
Traffic parameters
------------------
Separation buffer specified
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_runtime_on_roads_single_road`.
Precondition
``MinimumSeparationBuffer`` is set in the Spawner configuration.
Requirement
No two agents are spawned with a net distance lower than the specified separation buffer.
Verified by
Unit Test SpawnerRuntimeCommonParameterExtractor_ExtractMinimumSeparationBuffer_FixedValue
Separation buffer not specified
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precondition
Basic setup as as in :ref:`spawner_features_runtime_on_roads_single_road`.
Precondition
``MinimumSeparationBuffer`` is not set in the Spawner configuration.
Requirement
No two agents are spawned with a net distance lower than 5 m.
Verified by
Unit Test SpawnerRuntimeCommonParameterExtractor_ExtractMinimumSeparationBuffer_NoValue_SetsDefault
Stochastics
-----------
Traffic groups
^^^^^^^^^^^^^^
Requirement
The selection of traffic groups is randomized using a uniform distribution.
Verified by
UNTESTED
Agent profiles
^^^^^^^^^^^^^^
Requirement
The selection of agent profiles is randomized using a uniform distribution.
Verified by
UNTESTED
Velocity distribution
^^^^^^^^^^^^^^^^^^^^^
Requirement
The distribution of the velocities of a traffic group has to match the configured distribution.
Verified by
UNTESTED
Also has to be checked by analysis of simulation output by an external tool
TGap distribution
^^^^^^^^^^^^^^^^^
Requirement
The distribution of the TGaps of a traffic group has to match the configured distribution.
Verified by
UNTESTED
Also has to be checked by analysis of simulation output by an external tool
...@@ -42,7 +42,7 @@ PreRunSpawner ...@@ -42,7 +42,7 @@ PreRunSpawner
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
The PreRunSpawner is responsible for populating the scenery/world with Common-Agents before the simulator starts. The PreRunSpawner is responsible for populating the scenery/world with Common-Agents before the simulator starts.
This Spawner only acts once before the simulator starts and not during the simulation run. This Spawner only acts once before the simulator starts and is not active during the simulation run.
The PreRunSpawner needs a list of SpawnZones that define where it will spawn agents and a list of weighted :ref:`components_trafficgroups` that defines the type and parameters of the spawned agents. The PreRunSpawner needs a list of SpawnZones that define where it will spawn agents and a list of weighted :ref:`components_trafficgroups` that defines the type and parameters of the spawned agents.
The SpawnZones have the following parameters: The SpawnZones have the following parameters:
...@@ -67,9 +67,9 @@ The SpawnZones have the following parameters: ...@@ -67,9 +67,9 @@ The SpawnZones have the following parameters:
If neither is given the whole road is included If neither is given the whole road is included
========= ============ ==== ======== ================================================================================== ========= ============ ==== ======== ==================================================================================
.. note:: .. note::
Two SpawnZones should not intersect each other. The behavior in this case is undefined. The PreRunSpawner is not required to fill the SpawnZones in the given order. Lanes of two SpawnZones should not intersect each other. The behavior in this case is undefined. The PreRunSpawner is not required to fill the SpawnZones in the given order.
SStart, SEnd and SLength may be out of range for the road. SStart, SEnd and SLength may be out of range for the road.
In this case they are cropped such that the spawn range is maximum within the road's bounds. In this case they are cropped such that the spawn range is maximum within the road's bounds.
...@@ -152,7 +152,7 @@ Once the spawning ranges are determined the PreRunSpawner will spawn for each sp ...@@ -152,7 +152,7 @@ Once the spawning ranges are determined the PreRunSpawner will spawn for each sp
.. _components_runtimespawner: .. _components_runtimespawner:
RuntimeSpawner RuntimeSpawner
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
The RuntimeSpawner (included in library "SpawnerRuntimeCommon_OSI") is responsible for maintaining a populated scenery throughout the simulation runtime. The RuntimeSpawner (included in library "SpawnerRuntimeCommon_OSI") is responsible for maintaining a populated scenery throughout the simulation runtime.
It acts at each timestep throughout the simulation run and attempts to spawn Common Agents at the specified location(s). It acts at each timestep throughout the simulation run and attempts to spawn Common Agents at the specified location(s).
......
...@@ -98,10 +98,10 @@ ...@@ -98,10 +98,10 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element maxOccurs="unbounded" ref="Bool"/> <xs:element maxOccurs="unbounded" ref="Bool"/>
<xs:element maxOccurs="unbounded" ref="Double"/> <xs:element maxOccurs="unbounded" ref="Double"/>
<xs:element maxOccurs="unbounded" ref="NormalDistribution"/>
<xs:element maxOccurs="unbounded" ref="String"/> <xs:element maxOccurs="unbounded" ref="String"/>
<xs:element maxOccurs="unbounded" ref="Double"/> <xs:element maxOccurs="unbounded" ref="Double"/>
<xs:element maxOccurs="unbounded" ref="List"/> <xs:element maxOccurs="unbounded" ref="List"/>
<xs:element maxOccurs="unbounded" ref="UniformDistribution"/>
<xs:element maxOccurs="unbounded" ref="NormalDistribution"/> <xs:element maxOccurs="unbounded" ref="NormalDistribution"/>
<xs:element maxOccurs="unbounded" ref="LogNormalDistribution"/> <xs:element maxOccurs="unbounded" ref="LogNormalDistribution"/>
<xs:element maxOccurs="unbounded" ref="DoubleVector"/> <xs:element maxOccurs="unbounded" ref="DoubleVector"/>
...@@ -131,6 +131,13 @@ ...@@ -131,6 +131,13 @@
<xs:attribute name="Value" use="required" type="xs:double"/> <xs:attribute name="Value" use="required" type="xs:double"/>
<