Class SumoIndex
java.lang.Object
org.eclipse.mosaic.fed.application.ambassador.simulation.perception.index.providers.VehicleIndex
org.eclipse.mosaic.fed.application.ambassador.simulation.perception.index.providers.SumoIndex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePerceptionModule
(PerceptionModuleOwner owner, Database database, org.slf4j.Logger log) Creates the perception module to be used for perception purposes.int
Returns the number of indexed vehicles.getVehiclesInRange
(PerceptionModel perceptionModel) Queries theTrafficObjectIndex
and returns all vehicles inside thePerceptionModel
.void
Method called to initialize index after configuration has been read.void
removeVehicles
(Iterable<String> vehiclesToRemove) Remove all vehicles from theVehicleIndex
by a list of vehicle ids.void
updateVehicles
(Iterable<VehicleData> vehiclesToUpdate) Updates theTrafficObjectIndex
with a list ofVehicleData
objects.Methods inherited from class org.eclipse.mosaic.fed.application.ambassador.simulation.perception.index.providers.VehicleIndex
registerVehicleType
-
Constructor Details
-
SumoIndex
public SumoIndex()
-
-
Method Details
-
initialize
public void initialize()Description copied from class:VehicleIndex
Method called to initialize index after configuration has been read.- Specified by:
initialize
in classVehicleIndex
-
getVehiclesInRange
Description copied from class:VehicleIndex
Queries theTrafficObjectIndex
and returns all vehicles inside thePerceptionModel
.- Specified by:
getVehiclesInRange
in classVehicleIndex
-
removeVehicles
Description copied from class:VehicleIndex
Remove all vehicles from theVehicleIndex
by a list of vehicle ids. When vehicles are removed from simulation we can remove the cachedVehicleType
.- Overrides:
removeVehicles
in classVehicleIndex
- Parameters:
vehiclesToRemove
- the list of vehicles to remove from the index
-
updateVehicles
Description copied from class:VehicleIndex
Updates theTrafficObjectIndex
with a list ofVehicleData
objects.- Overrides:
updateVehicles
in classVehicleIndex
- Parameters:
vehiclesToUpdate
- the list of vehicles to add or update in the index
-
getNumberOfVehicles
public int getNumberOfVehicles()Description copied from class:VehicleIndex
Returns the number of indexed vehicles.- Overrides:
getNumberOfVehicles
in classVehicleIndex
- Returns:
- the number of vehicles
-
createPerceptionModule
public PerceptionModule<SimplePerceptionConfiguration> createPerceptionModule(PerceptionModuleOwner owner, Database database, org.slf4j.Logger log) Description copied from class:VehicleIndex
Creates the perception module to be used for perception purposes. Allows for the implementation of different provider sources.- Specified by:
createPerceptionModule
in classVehicleIndex
- Parameters:
owner
- the unit the perception module belongs todatabase
- the database for the scenariolog
- the logger- Returns:
- an instantiated perception module
-