G - GTU typepublic abstract class AbstractPerception<G extends GTU> extends Object implements Perception<G>
Copyright (c) 2013-2017 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(G gtu)
Construct perception.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends PerceptionCategory<?,?>> |
addPerceptionCategory(T perceptionCategory)
Adds given perception category to the perception.
|
<T extends PerceptionCategory<?,?>> |
contains(Class<T> category)
Returns whether the given perception category is present.
|
G |
getGtu()
Return the GTU of this perception.
|
<T extends PerceptionCategory<?,?>> |
getPerceptionCategory(Class<T> category)
Returns the given perception category.
|
<T extends PerceptionCategory<?,?>> |
getPerceptionCategoryOrNull(Class<T> category)
Returns the given perception category, or
null if not present. |
void |
perceive()
Update the perceived information and store it in a stateful manner.
|
void |
removePerceptionCategory(PerceptionCategory<?,?> perceptionCategory)
Remove give perception category.
|
String |
toString() |
public AbstractPerception(G gtu)
gtu - GTUpublic G getGtu()
getGtu in interface Perception<G extends GTU>public final <T extends PerceptionCategory<?,?>> void addPerceptionCategory(T perceptionCategory)
addPerceptionCategory in interface Perception<G extends GTU>T - perception category typeperceptionCategory - perception categorypublic final <T extends PerceptionCategory<?,?>> boolean contains(Class<T> category)
contains in interface Perception<G extends GTU>T - perception categorycategory - perception category classpublic final <T extends PerceptionCategory<?,?>> T getPerceptionCategory(Class<T> category) throws OperationalPlanException
getPerceptionCategory in interface Perception<G extends GTU>T - perception categorycategory - perception category classOperationalPlanException - if the perception category is not presentpublic final <T extends PerceptionCategory<?,?>> T getPerceptionCategoryOrNull(Class<T> category)
null if not present.getPerceptionCategoryOrNull in interface Perception<G extends GTU>T - perception categorycategory - perception category classpublic final void removePerceptionCategory(PerceptionCategory<?,?> perceptionCategory)
removePerceptionCategory in interface Perception<G extends GTU>perceptionCategory - perception category to removepublic void perceive()
throws GTUException,
NetworkException,
org.opentrafficsim.base.parameters.ParameterException
perceive in interface Perception<G extends GTU>GTUException - when GTU has not been properly initialized.NetworkException - in case of inconsistencies in the network during perception calculations.org.opentrafficsim.base.parameters.ParameterException - in case of a parameter error.Copyright © 2014–2018 Delft University of Technology. All rights reserved.