VANET Simulator
 All Classes Functions Variables
Public Member Functions | List of all members
vanetsim.map.JunctionQueue Class Reference

Public Member Functions

 JunctionQueue ()
 
synchronized boolean addVehicle (Vehicle vehicle)
 
synchronized boolean delVehicle (Vehicle vehicle)
 
synchronized void delFirstVehicle ()
 
synchronized void cleanUp ()
 
Vehicle getFirstVehicle ()
 
int size ()
 

Detailed Description

A queue for the vehicles waiting on a junction.

Constructor & Destructor Documentation

vanetsim.map.JunctionQueue.JunctionQueue ( )
inline

Constructor.

Member Function Documentation

synchronized boolean vanetsim.map.JunctionQueue.addVehicle ( Vehicle  vehicle)
inline

Adds a vehicle to the queue. If it already exists, the lastSeen-time is updated.

Parameters
vehiclethe vehicle to add
Returns
true if a vehicle was added, false if it previously existed in this queue.
synchronized void vanetsim.map.JunctionQueue.cleanUp ( )
inline

Cleans up. This removes vehicles which haven't been seen for a long time and thus prevents from stalls.

synchronized void vanetsim.map.JunctionQueue.delFirstVehicle ( )
inline

Deletes the first vehicle in this queue.

synchronized boolean vanetsim.map.JunctionQueue.delVehicle ( Vehicle  vehicle)
inline

Removes a vehicle from the queue.

Parameters
vehiclethe vehicles to remove
Returns
true if a vehicle was found and deleted, else false
Vehicle vanetsim.map.JunctionQueue.getFirstVehicle ( )
inline

Gets the first vehicle in this queue.

Returns
the first vehicle in this queue
int vanetsim.map.JunctionQueue.size ( )
inline

Returns the size of this queue.

Returns
size_ the size of this queue

The documentation for this class was generated from the following file: