public abstract class AbstractPerception extends Object implements Perception
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Constructor and Description |
|---|
AbstractPerception(GTU gtu)
Construct perception.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPerceptionCategory(AbstractPerceptionCategory perceptionCategory)
Adds given perception category to the perception.
|
<T extends AbstractPerceptionCategory> |
contains(Class<T> clazz)
Returns whether the given perception category is present.
|
GTU |
getGtu()
Return the GTU of this perception.
|
<T extends AbstractPerceptionCategory> |
getPerceptionCategory(Class<T> clazz)
Returns the given perception category.
|
void |
perceive()
Update the perceived information and store it in a stateful manner.
|
void |
removePerceptionCategory(AbstractPerceptionCategory perceptionCategory)
Remove give perception category.
|
String |
toString() |
public AbstractPerception(GTU gtu)
gtu - GTUpublic GTU getGtu()
getGtu in interface Perceptionpublic final void addPerceptionCategory(AbstractPerceptionCategory perceptionCategory)
addPerceptionCategory in interface PerceptionperceptionCategory - perception categorypublic final <T extends AbstractPerceptionCategory> boolean contains(Class<T> clazz)
contains in interface PerceptionT - perception categoryclazz - perception category classpublic final <T extends AbstractPerceptionCategory> T getPerceptionCategory(Class<T> clazz) throws OperationalPlanException
getPerceptionCategory in interface PerceptionT - perception categoryclazz - perception category classOperationalPlanException - if the perception category is not presentpublic final void removePerceptionCategory(AbstractPerceptionCategory perceptionCategory)
removePerceptionCategory in interface PerceptionperceptionCategory - perception category to removepublic void perceive()
throws GTUException,
NetworkException,
ParameterException
perceive in interface PerceptionGTUException - 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.Copyright © 2014–2016 Delft University of Technology. All rights reserved.