Class ArTaskHeadwayBased
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.AbstractTask
org.opentrafficsim.road.gtu.lane.perception.mental.ar.AbstractArTask
org.opentrafficsim.road.gtu.lane.perception.mental.ar.ArTaskHeadwayBased
- All Implemented Interfaces:
Identifiable,ArTask,Task
- Direct Known Subclasses:
ArTaskCarFollowing,ArTaskLaneChanging
Task class that translates a (composite) headway in to a task demand.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateTaskDemand(LanePerception perception) Calculates the task demand.protected abstract DurationgetHeadway(LanePerception perception, LaneBasedGtu gtu, Parameters parameters) Returns a collector for the task demand.protected SpeedgetSpeed()Returns the current speed to translate a distance headway to a time headway.Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.mental.ar.AbstractArTask
getAnticipationReliance, setAnticipationReliance, toStringMethods inherited from class org.opentrafficsim.road.gtu.lane.perception.mental.AbstractTask
getId, getTaskDemand, getTaskDemandMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.base.Identifiable
getIdMethods inherited from interface org.opentrafficsim.road.gtu.lane.perception.mental.Task
getTaskDemand, getTaskDemand
-
Constructor Details
-
ArTaskHeadwayBased
Constructor.- Parameters:
id- id
-
-
Method Details
-
calculateTaskDemand
Description copied from class:AbstractTaskCalculates the task demand.- Specified by:
calculateTaskDemandin classAbstractTask- Parameters:
perception- perception- Returns:
- task demand
- Throws:
ParameterException- if a parameter is missing or out of bounds
-
getSpeed
Returns the current speed to translate a distance headway to a time headway.- Returns:
- speed
-
getHeadway
protected abstract Duration getHeadway(LanePerception perception, LaneBasedGtu gtu, Parameters parameters) throws ParameterException Returns a collector for the task demand.- Parameters:
perception- perceptiongtu- gtuparameters- parameters- Returns:
- headway,
nullof none. - Throws:
ParameterException- on invalid parameter
-