aim4.driver
Class CrashTestDummy
java.lang.Object
aim4.driver.Driver
aim4.driver.CrashTestDummy
- All Implemented Interfaces:
- DriverSimView
public class CrashTestDummy
- extends Driver
A driver agent that only steers and changes lanes when appropriate.
Methods inherited from class aim4.driver.Driver |
addCurrentlyOccupiedLane, distanceFromPrevIntersection, distanceToNextIntersection, getCurrentLane, getCurrentlyOccupiedLanes, getDestination, getSpawnPoint, nextIntersectionManager, setCurrentLane, setDestination, setSpawnPoint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CrashTestDummy
public CrashTestDummy(AutoVehicleDriverView vehicle,
Lane arrivalLane,
Lane departureLane)
- Construct a new CrashTestDummy to pilot the simulated vehicle across
an intersection.
- Parameters:
vehicle
- the simulated vehicle to pilotarrivalLane
- the Lane in which the vehicle should enter the
intersectiondepartureLane
- the Lane in which the vehicle should depart the
intersection
act
public void act()
- Take steering actions to guide a test vehicle through a simulated
traversal of the intersection.
- Specified by:
act
in interface DriverSimView
- Overrides:
act
in class Driver
getVehicle
public AutoVehicleDriverView getVehicle()
- Get the Vehicle this driver agent is controlling.
- Specified by:
getVehicle
in interface DriverSimView
- Specified by:
getVehicle
in class Driver
- Returns:
- the Vehicle this driver agent is controlling
calculateTraversingLaneChangeDistance
public double calculateTraversingLaneChangeDistance()
- Determine the distance at which to change lanes during the
traversing inside an intersection. Currently just
multiplies the TRAVERSING_LANE_CHANGE_LEAD_TIME by the
reading from the Vehicle's speedometer.
- Returns:
- the distance at which the Driver should turn the Vehicle into
the lane to which it is changing
Copyright © 2011. All Rights Reserved.