Class DirectEgoPerception<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>
-
- org.opentrafficsim.core.gtu.perception.DirectEgoPerception<G,P>
-
- Type Parameters:
G- GTU typeP- perception type
- All Implemented Interfaces:
java.io.Serializable,EgoPerception<G,P>,PerceptionCategory<G,P>
public class DirectEgoPerception<G extends GTU,P extends Perception<G>> extends AbstractPerceptionCategory<G,P> implements EgoPerception<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 29, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectEgoPerception(P perception)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)AccelerationgetAcceleration()Returns the acceleration.LengthgetLength()Returns the length.SpeedgetSpeed()Returns the speed.TimeStampedObject<Acceleration>getTimeStampedAcceleration()Return the time stamped acceleration.TimeStampedObject<Length>getTimeStampedLength()Return the time stamped length.TimeStampedObject<Speed>getTimeStampedSpeed()Return the time stamped speed.TimeStampedObject<Length>getTimeStampedWidth()Return the time stamped width.LengthgetWidth()Returns the width.inthashCode()java.lang.StringtoString()voidupdateAcceleration()Update acceleration.voidupdateLength()Update length.voidupdateSpeed()Update speed.voidupdateWidth()Update width.-
Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
getGtu, getObjectOrNull, getPerception, getTimestamp
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.core.gtu.perception.EgoPerception
updateAll
-
-
-
-
Constructor Detail
-
DirectEgoPerception
public DirectEgoPerception(P perception)
- Parameters:
perception- P; perception
-
-
Method Detail
-
updateSpeed
public final void updateSpeed() throws GTUExceptionUpdate speed.- Specified by:
updateSpeedin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Throws:
GTUException- if the GTU has not been initialized
-
updateAcceleration
public final void updateAcceleration() throws GTUExceptionUpdate acceleration.- Specified by:
updateAccelerationin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Throws:
GTUException- if the GTU has not been initialized
-
updateLength
public final void updateLength() throws GTUExceptionUpdate length.- Specified by:
updateLengthin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Throws:
GTUException- if the GTU has not been initialized
-
updateWidth
public final void updateWidth() throws GTUExceptionUpdate width.- Specified by:
updateWidthin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Throws:
GTUException- if the GTU has not been initialized
-
getAcceleration
public final Acceleration getAcceleration()
Returns the acceleration.- Specified by:
getAccelerationin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Returns:
- acceleration
-
getSpeed
public final Speed getSpeed()
Returns the speed.- Specified by:
getSpeedin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Returns:
- speed
-
getLength
public final Length getLength()
Returns the length.- Specified by:
getLengthin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Returns:
- length
-
getWidth
public final Length getWidth()
Returns the width.- Specified by:
getWidthin interfaceEgoPerception<G extends GTU,P extends Perception<G>>- Returns:
- width
-
getTimeStampedSpeed
public final TimeStampedObject<Speed> getTimeStampedSpeed()
Return the time stamped speed.- Returns:
- time stamped speed
-
getTimeStampedAcceleration
public final TimeStampedObject<Acceleration> getTimeStampedAcceleration()
Return the time stamped acceleration.- Returns:
- time stamped acceleration
-
getTimeStampedLength
public final TimeStampedObject<Length> getTimeStampedLength()
Return the time stamped length.- Returns:
- time stamped length
-
getTimeStampedWidth
public final TimeStampedObject<Length> getTimeStampedWidth()
Return the time stamped width.- Returns:
- time stamped width
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-