public abstract class Driver extends Object implements DriverSimView
AutoVehicleDriverView.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Driver() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected Lane currentLane
public void act()
act in interface DriverSimViewpublic abstract VehicleDriverView getVehicle()
getVehicle in interface DriverSimViewpublic SpawnPoint getSpawnPoint()
getSpawnPoint in interface DriverSimViewpublic void setSpawnPoint(SpawnPoint spawnPoint)
setSpawnPoint in interface DriverSimViewspawnPoint - the spawn point that generated the driverpublic Road getDestination()
getDestination in interface DriverSimViewpublic void setDestination(Road destination)
setDestination in interface DriverSimViewdestination - the Road where this DriverAgent should gopublic Lane getCurrentLane()
getCurrentLane in interface DriverSimViewpublic void setCurrentLane(Lane lane)
setCurrentLane in interface DriverSimViewlane - the Lane the DriverAgent should followpublic Set<Lane> getCurrentlyOccupiedLanes()
getCurrentlyOccupiedLanes in interface DriverSimViewpublic void addCurrentlyOccupiedLane(Lane lane)
lane - a lane that the DriverAgent's vehicle currently occupiesprotected IntersectionManager nextIntersectionManager()
protected double distanceToNextIntersection()
protected double distanceFromPrevIntersection()
Copyright © 2013. All rights reserved.