Class AbstractPerceptionCategory<G extends GTU,​P extends Perception<G>>

java.lang.Object
org.opentrafficsim.base.Type<AbstractPerceptionCategory<G,​P>>
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<G,​P>
Type Parameters:
G - GTU type
P - perception type
All Implemented Interfaces:
Serializable, PerceptionCategory<G,​P>
Direct Known Subclasses:
DirectEgoPerception

public abstract class AbstractPerceptionCategory<G extends GTU,​P extends Perception<G>>
extends Type<AbstractPerceptionCategory<G,​P>>
implements Serializable, PerceptionCategory<G,​P>

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version Jul 14, 2016
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
Serialized Form
  • Constructor Details

    • AbstractPerceptionCategory

      public AbstractPerceptionCategory​(P perception)
      Constructor setting the perception.
      Parameters:
      perception - P; perception
  • Method Details

    • getPerception

      public P getPerception()
      Returns the connected perception.
      Returns:
      connected perception
    • getGtu

      public G getGtu() throws GTUException
      Returns the connected GTU.
      Returns:
      connected GTU
      Throws:
      GTUException - if the GTU has not been initialized
    • getTimestamp

      public final Time getTimestamp() throws GTUException
      Returns the current time.
      Returns:
      current time
      Throws:
      GTUException - if the GTU has not been initialized
    • getObjectOrNull

      protected final <T> T getObjectOrNull​(TimeStampedObject<T> object)
      Returns the object inside a time stamped object, or null if it's null.
      Type Parameters:
      T - type of time stamped object
      Parameters:
      object - TimeStampedObject<T>; time stamped object
      Returns:
      the object inside a time stamped object, or null if it's null