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.

- - ### Field Summary

    - ### Fields inherited from class aim4.driver.Driver

      `currentLane, currentlyOccupiedLanes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CrashTestDummy(AutoVehicleDriverView vehicle, Lane arrivalLane, Lane departureLane)` Construct a new CrashTestDummy to pilot the simulated vehicle across an intersection.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `act()` Take steering actions to guide a test vehicle through a simulated traversal of the intersection.
    `double` | `calculateTraversingLaneChangeDistance()` Determine the distance at which to change lanes during the traversing inside an intersection.
    `AutoVehicleDriverView` | `getVehicle()` Get the Vehicle this driver agent is controlling.

    - ### 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`

- - ### Constructor Detail

    - #### 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 pilot
        `arrivalLane` - the Lane in which the vehicle should enter the intersection
        `departureLane` - the Lane in which the vehicle should depart the intersection

  - ### Method Detail

    - #### 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 © 2013. All rights reserved.