|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.im.IntersectionManager
public class IntersectionManager
An agent to manage an intersection. This is an abstract class that sets up the properties of the intersection when it is created.
Field Summary | |
---|---|
protected double |
currentTime
the current time of the intersection manager |
protected int |
id
The ID number of this intersection manager. |
Constructor Summary | |
---|---|
IntersectionManager(Intersection intersection,
TrackModel trackModel,
double currentTime,
Registry<IntersectionManager> imRegistry)
Create an intersection manager. |
Method Summary | |
---|---|
void |
act(double timeStep)
Take any actions for a certain period of time. |
void |
checkCurrentTime(double currentTime)
Check whether this intersection manager's time is current. |
boolean |
contains(VehicleSimView vehicle)
Determine whether the given Vehicle is currently entirely contained within the Area governed by this IntersectionManager. |
double |
getCurrentTime()
Get the current time. |
List<? extends Shape> |
getDebugShapes()
Get any shapes to display for debugging purposes. |
int |
getId()
Get the unique ID number of this IntersectionManager. |
Intersection |
getIntersection()
Get the intersection managed by this intersection manager. |
List<Lane> |
getSortedDepartureLanes(Lane arrivalLane,
Road departure)
Given an arrival Lane and a departure Road, get an ordered List of Lanes that represents the Lanes from highest to lowest priority based on distance from the arrival Lane. |
TrackModel |
getTrackModel()
Get the track model. |
boolean |
intersects(Rectangle2D rectangle)
Determine whether the given Rectangle intersects the Area governed by this IntersectionManager. |
boolean |
manages(Lane l)
Whether or not this IntersectionManager manages the given Lane. |
boolean |
manages(Road r)
Whether or not this IntersectionManager manages the given Road. |
void |
printData(String outFileName)
Print the collected data to a file |
double |
traversalDistance(int arrivalID,
int departureID)
Get the distance from the entry of the Lane with the first given ID, to the departure of the Lane with the other given ID, if traveling along segments through their point of intersection. |
double |
traversalDistance(Lane arrival,
Lane departure)
Get the distance from the entry of the given Lane, to the departure of the other given Lane, if traveling along segments through their point of intersection. |
double |
traversalDistance(Road arrival,
Road departure)
Get the distance from the entry of the given Road, to the departure of the other given Road. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int id
protected double currentTime
Constructor Detail |
---|
public IntersectionManager(Intersection intersection, TrackModel trackModel, double currentTime, Registry<IntersectionManager> imRegistry)
intersection
- an intersectiontrackModel
- a path model of the intersectioncurrentTime
- the current timeimRegistry
- an intersection manager registryMethod Detail |
---|
public void act(double timeStep)
timeStep
- the size of the time step to simulate, in secondspublic int getId()
public double getCurrentTime()
public Intersection getIntersection()
public TrackModel getTrackModel()
public boolean manages(Road r)
r
- the Road
public boolean manages(Lane l)
l
- the Lane
public boolean contains(VehicleSimView vehicle)
vehicle
- the Vehicle
public boolean intersects(Rectangle2D rectangle)
rectangle
- the Rectangle
public List<Lane> getSortedDepartureLanes(Lane arrivalLane, Road departure)
arrivalLane
- the Lane in which the vehicle is arrivingdeparture
- the Road by which the vehicle is departing
public double traversalDistance(Road arrival, Road departure)
arrival
- the arrival Roaddeparture
- the departure Road
public double traversalDistance(Lane arrival, Lane departure)
arrival
- the arrival Lanedeparture
- the departure Lane
public double traversalDistance(int arrivalID, int departureID)
arrivalID
- the ID number of the arrival LanedepartureID
- the ID number of the departure Lane
public void printData(String outFileName)
outFileName
- the name of the file to which the data are outputted.public void checkCurrentTime(double currentTime)
currentTime
- the current timepublic List<? extends Shape> getDebugShapes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |