|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.driver.Driver aim4.driver.AutoDriver
public class AutoDriver
An agent that drives a AutoVehicleDriverView
while coordinating with
IntersectionManager
s 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.
Field Summary |
---|
Fields inherited from class aim4.driver.Driver |
---|
currentLane, currentlyOccupiedLanes |
Constructor Summary | |
---|---|
AutoDriver(AutoVehicleDriverView vehicle,
BasicMap basicMap)
|
Method Summary | |
---|---|
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. |
Methods inherited from class aim4.driver.Driver |
---|
addCurrentlyOccupiedLane, getCurrentLane, getCurrentlyOccupiedLanes, getDestination, getSpawnPoint, setCurrentLane, setDestination, setSpawnPoint |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface aim4.driver.AutoDriverCoordinatorView |
---|
addCurrentlyOccupiedLane, getCurrentLane, getDestination, setCurrentLane |
Methods inherited from interface aim4.driver.AutoDriverPilotView |
---|
getCurrentLane, setCurrentLane |
Constructor Detail |
---|
public AutoDriver(AutoVehicleDriverView vehicle, BasicMap basicMap)
Method Detail |
---|
public void act()
act
in interface DriverSimView
act
in class Driver
public AutoVehicleDriverView getVehicle()
getVehicle
in interface AutoDriverPilotView
getVehicle
in interface DriverSimView
getVehicle
in class Driver
public Coordinator getCurrentCoordinator()
public IntersectionManager getCurrentIM()
getCurrentIM
in interface AutoDriverCoordinatorView
getCurrentIM
in interface AutoDriverPilotView
public IntersectionManager nextIntersectionManager()
Driver
, but only to memoize it for
speed.
nextIntersectionManager
in interface AutoDriverCoordinatorView
nextIntersectionManager
in class Driver
public double distanceToNextIntersection()
Driver
, but only to memoize it for
speed.
distanceToNextIntersection
in interface AutoDriverCoordinatorView
distanceToNextIntersection
in interface AutoDriverPilotView
distanceToNextIntersection
in class Driver
public double distanceFromPrevIntersection()
distanceFromPrevIntersection
in interface AutoDriverCoordinatorView
distanceFromPrevIntersection
in class Driver
public boolean inCurrentIntersection()
inCurrentIntersection
in interface AutoDriverCoordinatorView
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |