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:
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-2022 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 boolean
equals(Object obj)
Acceleration
getAcceleration()
Returns the acceleration.Length
getLength()
Returns the length.Speed
getSpeed()
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.Length
getWidth()
Returns the width.int
hashCode()
String
toString()
void
updateAcceleration()
Update acceleration.void
updateLength()
Update length.void
updateSpeed()
Update speed.void
updateWidth()
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 GTUException
Update speed.- Specified by:
updateSpeed
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Throws:
GTUException
- if the GTU has not been initialized
-
updateAcceleration
public final void updateAcceleration() throws GTUException
Update acceleration.- Specified by:
updateAcceleration
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Throws:
GTUException
- if the GTU has not been initialized
-
updateLength
public final void updateLength() throws GTUException
Update length.- Specified by:
updateLength
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Throws:
GTUException
- if the GTU has not been initialized
-
updateWidth
public final void updateWidth() throws GTUException
Update width.- Specified by:
updateWidth
in 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:
getAcceleration
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Returns:
- acceleration
-
getSpeed
public final Speed getSpeed()
Returns the speed.- Specified by:
getSpeed
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Returns:
- speed
-
getLength
public final Length getLength()
Returns the length.- Specified by:
getLength
in interfaceEgoPerception<G extends GTU,P extends Perception<G>>
- Returns:
- length
-
getWidth
public final Length getWidth()
Returns the width.- Specified by:
getWidth
in 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
-
-