public class AutoDriver extends Driver implements AutoDriverCoordinatorView, AutoDriverPilotView
AutoVehicleDriverView while coordinating with
IntersectionManagers and other Vehicles. Such an agent consists
of two sub-agents, a Coordinator and a Pilot. The two
agents communicate by setting state in this class.currentLane, currentlyOccupiedLanes| Constructor and Description |
|---|
AutoDriver(AutoVehicleDriverView vehicle,
BasicMap basicMap) |
| Modifier and Type | Method and Description |
|---|---|
void |
act()
Take control actions for driving the agent's Vehicle.
|
double |
distanceFromPrevIntersection()
Find the distance from the previous intersection in the Lane in which
the Vehicle is, from the position at which the Vehicle is.
|
double |
distanceToNextIntersection()
Find the distance to the next intersection in the Lane in which
the Vehicle is, from the position at which the Vehicle is.
|
Coordinator |
getCurrentCoordinator()
Get the current coordinator of the vehicle.
|
IntersectionManager |
getCurrentIM()
Get the IntersectionManager with which the agent is currently
interacting.
|
AutoVehicleDriverView |
getVehicle()
Get the Vehicle this DriverAgent is controlling.
|
boolean |
inCurrentIntersection()
Whether or not the Vehicle controlled by this driver agent
is inside the intersection managed by the current IntersectionManager.
|
IntersectionManager |
nextIntersectionManager()
Find the next IntersectionManager that the Vehicle will need to
interact with, in this Lane.
|
addCurrentlyOccupiedLane, getCurrentLane, getCurrentlyOccupiedLanes, getDestination, getSpawnPoint, setCurrentLane, setDestination, setSpawnPointclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCurrentlyOccupiedLane, getCurrentLane, getDestination, setCurrentLanegetCurrentLane, setCurrentLanepublic AutoDriver(AutoVehicleDriverView vehicle, BasicMap basicMap)
public void act()
act in interface DriverSimViewact in class Driverpublic AutoVehicleDriverView getVehicle()
getVehicle in interface AutoDriverPilotViewgetVehicle in interface DriverSimViewgetVehicle in class Driverpublic Coordinator getCurrentCoordinator()
public IntersectionManager getCurrentIM()
getCurrentIM in interface AutoDriverCoordinatorViewgetCurrentIM in interface AutoDriverPilotViewpublic IntersectionManager nextIntersectionManager()
Driver, but only to memoize it for
speed.nextIntersectionManager in interface AutoDriverCoordinatorViewnextIntersectionManager in class Driverpublic double distanceToNextIntersection()
Driver, but only to memoize it for
speed.distanceToNextIntersection in interface AutoDriverCoordinatorViewdistanceToNextIntersection in interface AutoDriverPilotViewdistanceToNextIntersection in class Driverpublic double distanceFromPrevIntersection()
distanceFromPrevIntersection in interface AutoDriverCoordinatorViewdistanceFromPrevIntersection in class Driverpublic boolean inCurrentIntersection()
inCurrentIntersection in interface AutoDriverCoordinatorViewCopyright © 2013. All rights reserved.