|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.driver.Driver
public abstract class Driver
An agent that drives a AutoVehicleDriverView
.
Field Summary | |
---|---|
protected Lane |
currentLane
The Lane that the driver is currently following. |
protected Set<Lane> |
currentlyOccupiedLanes
The set of Lanes that the vehicle is currently occupied |
Constructor Summary | |
---|---|
Driver()
|
Method Summary | |
---|---|
void |
act()
Take control actions for driving the agent's Vehicle. |
void |
addCurrentlyOccupiedLane(Lane lane)
Add a lane that the DriverAgent's vehicle currently occupies. |
protected 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. |
protected 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. |
Lane |
getCurrentLane()
Get the Lane the DriverAgent is currently following. |
Set<Lane> |
getCurrentlyOccupiedLanes()
Get the lanes the DriverAgent's vehicle currently occupies. |
Road |
getDestination()
Get where this driver is going. |
SpawnPoint |
getSpawnPoint()
Get where this DriverAgent is coming from. |
abstract VehicleDriverView |
getVehicle()
Get the Vehicle this driver agent is controlling. |
protected IntersectionManager |
nextIntersectionManager()
Find the next IntersectionManager that the Vehicle will need to interact with, in this Lane. |
void |
setCurrentLane(Lane lane)
Set the Lane the DriverAgent is currently following. |
void |
setDestination(Road destination)
Set where this driver agent is going. |
void |
setSpawnPoint(SpawnPoint spawnPoint)
Set where this driver agent is coming from. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Lane currentLane
protected Set<Lane> currentlyOccupiedLanes
Constructor Detail |
---|
public Driver()
Method Detail |
---|
public void act()
act
in interface DriverSimView
public abstract VehicleDriverView getVehicle()
getVehicle
in interface DriverSimView
public SpawnPoint getSpawnPoint()
getSpawnPoint
in interface DriverSimView
public void setSpawnPoint(SpawnPoint spawnPoint)
setSpawnPoint
in interface DriverSimView
spawnPoint
- the spawn point that generated the driverpublic Road getDestination()
getDestination
in interface DriverSimView
public void setDestination(Road destination)
setDestination
in interface DriverSimView
destination
- the Road where this DriverAgent should gopublic Lane getCurrentLane()
getCurrentLane
in interface DriverSimView
public void setCurrentLane(Lane lane)
setCurrentLane
in interface DriverSimView
lane
- the Lane the DriverAgent should followpublic Set<Lane> getCurrentlyOccupiedLanes()
getCurrentlyOccupiedLanes
in interface DriverSimView
public void addCurrentlyOccupiedLane(Lane lane)
lane
- a lane that the DriverAgent's vehicle currently occupiesprotected IntersectionManager nextIntersectionManager()
protected double distanceToNextIntersection()
protected double distanceFromPrevIntersection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |