Interface Perception<G extends GTU>
- Type Parameters:
G- GTU type
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractPerception
public interface Perception<G extends GTU> extends Serializable
The perception module of a GTU. It is responsible for perceiving (sensing) the environment of the GTU, which includes the
locations of other GTUs. Perception is done at a certain time, and the perceived information might have a limited validity.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Method Summary
Modifier and Type Method Description <T extends PerceptionCategory<?, ?>>
voidaddPerceptionCategory(T perceptionCategory)Adds given perception category to the perception.<T extends PerceptionCategory<?, ?>>
booleancontains(Class<T> category)Returns whether the given perception category is present.GgetGtu()Return the GTU of this perception.<T extends PerceptionCategory<?, ?>>
TgetPerceptionCategory(Class<T> category)Returns the given perception category.<T extends PerceptionCategory<?, ?>>
TgetPerceptionCategoryOrNull(Class<T> category)Returns the given perception category, ornullif not present.voidperceive()Invoked by the GTU prior to determining the operational plan.voidremovePerceptionCategory(PerceptionCategory<?,?> perceptionCategory)Remove give perception category.
-
Method Details
-
perceive
Invoked by the GTU prior to determining the operational plan. If the implementation works in-sync with the tactical planner, this method is used to update perceived information. It is however possible for the implementation to ignore this and have fully autonomous perception.- Throws:
GTUException- when GTU has not been properly initialized.NetworkException- in case of inconsistencies in the network during perception calculations.ParameterException- in case of a parameter error.
-
getGtu
Return the GTU of this perception.- Returns:
- GTU of this perception
- Throws:
GTUException- if the GTU has not been initialized
-
addPerceptionCategory
Adds given perception category to the perception.- Type Parameters:
T- perception category type- Parameters:
perceptionCategory- T; perception category
-
contains
Returns whether the given perception category is present.- Type Parameters:
T- perception category- Parameters:
category- Class<T>; perception category class- Returns:
- whether the given perception category is present
-
getPerceptionCategory
<T extends PerceptionCategory<?, ?>> T getPerceptionCategory(Class<T> category) throws OperationalPlanExceptionReturns the given perception category.- Type Parameters:
T- perception category- Parameters:
category- Class<T>; perception category class- Returns:
- given perception category
- Throws:
OperationalPlanException- if the perception category is not present
-
getPerceptionCategoryOrNull
Returns the given perception category, ornullif not present.- Type Parameters:
T- perception category- Parameters:
category- Class<T>; perception category class- Returns:
- given perception category
-
removePerceptionCategory
Remove give perception category.- Parameters:
perceptionCategory- PerceptionCategory<?,?>; perception category to remove
-