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

Public Member Functions

 Region (int x, int y, int leftBoundary, int rightBoundary, int upperBoundary, int lowerBoundary)
 
Node addNode (Node node, boolean doCheck)
 
void delNode (Node node)
 
void addRSU (RSU rsu)
 
void delRSU (RSU rsu)
 
void addStreet (Street street, boolean doCheck)
 
void checkStreetsForBridges ()
 
void delStreet (Street street)
 
synchronized void addVehicle (Vehicle vehicle, boolean doCheck)
 
synchronized void delVehicle (Vehicle vehicle)
 
int getX ()
 
int getY ()
 
void calculateJunctions ()
 
void addMixZone (Node node, int radius)
 
void deleteMixZone (Node node)
 
void prepareLogs (Node[] nodes)
 
String[] getIntersectionPoints (Node mixNode, Region region12)
 
void clearMixZones ()
 
void clearRSUs ()
 
void cleanVehicles ()
 
void clearTrafficLights ()
 
Node[] getNodes ()
 
Node[] getMixZoneNodes ()
 
RSU[] getRSUs ()
 
Street[] getStreets ()
 
ArrayList< VehiclegetVehicleArrayList ()
 
Vehicle[] getVehicleArray ()
 
void createBacklink (WorkerThread thread, int numberinThread)
 
int getLeftBoundary ()
 
int getRightBoundary ()
 
int getUpperBoundary ()
 
int getLowerBoundary ()
 

Public Attributes

ArrayList< String > xxx = new ArrayList<String>()
 
ArrayList< String > yyy = new ArrayList<String>()
 
ArrayList< String > nnn = new ArrayList<String>()
 

Detailed Description

A region stores all objects in a specific part of the map. It stores streets, nodes and vehicles.

Constructor & Destructor Documentation

vanetsim.map.Region.Region ( int  x,
int  y,
int  leftBoundary,
int  rightBoundary,
int  upperBoundary,
int  lowerBoundary 
)
inline

Constructor for a region.

Parameters
xthe position on the x axis of the new region
ythe position on the y axis of the new region
leftBoundarythe coordinate of the left boundary
rightBoundarythe coordinate of the right boundary
upperBoundarythe coordinate of the upper boundary
lowerBoundarythe coordinate of the lower boundary

Member Function Documentation

void vanetsim.map.Region.addMixZone ( Node  node,
int  radius 
)
inline

adds mix zone at the location of "node" if no mix zone on this location already exists

Node vanetsim.map.Region.addNode ( Node  node,
boolean  doCheck 
)
inline

Function to add a node to this region.

Parameters
nodethe node to add
doChecktrue if a check should be made if this node already exists; else false to skip the test
Returns
the node added (might be different from node if it already existed and check was true)
void vanetsim.map.Region.addRSU ( RSU  rsu)
inline

Function to add a Road-Side-Units to this region.

Parameters
rsuthe RSU to add
void vanetsim.map.Region.addStreet ( Street  street,
boolean  doCheck 
)
inline

Function to add a street to this region. This also checks if it is intersecting with other streets in this region and sets the appropriate flag on the streets!

Parameters
streetthe street to add
doChecktrue if a check should be made if this street already exists; else false to skip the test
synchronized void vanetsim.map.Region.addVehicle ( Vehicle  vehicle,
boolean  doCheck 
)
inline

Function to add a vehicle to this region.

Parameters
vehiclevehicle to add
doChecktrue if a check should be made if this vehicle already exists; else false to skip the test
void vanetsim.map.Region.calculateJunctions ( )
inline

This function should be called before starting simulation. All nodes calculate if they are junctions and and what their priority streets are. Furthermore, mixing zones are generated.

void vanetsim.map.Region.checkStreetsForBridges ( )
inline

Checks all streets in this region for possible bridges.

void vanetsim.map.Region.cleanVehicles ( )
inline

This function should be called before initializing a new scenario to delete all vehicles.

void vanetsim.map.Region.clearMixZones ( )
inline

clear all mix zones from this region.

void vanetsim.map.Region.clearRSUs ( )
inline

clear all RSUs from this region.

void vanetsim.map.Region.clearTrafficLights ( )
inline

This function deletes all traffic lights in this region

void vanetsim.map.Region.createBacklink ( WorkerThread  thread,
int  numberinThread 
)
inline

Creates a backlink to the worker thread which computes this region.

Parameters
threadthe thread
numberinThreadthe number in the thread
void vanetsim.map.Region.deleteMixZone ( Node  node)
inline

deletes mix zone at the node

Parameters
nodeNode where mix zone is placed on
void vanetsim.map.Region.delNode ( Node  node)
inline

Delete a node.

Parameters
nodethe node
void vanetsim.map.Region.delRSU ( RSU  rsu)
inline

Delete a Road-Side-Unit.

Parameters
rsuthe RSU to delete
void vanetsim.map.Region.delStreet ( Street  street)
inline

Delete a street.

Parameters
streetthe street
synchronized void vanetsim.map.Region.delVehicle ( Vehicle  vehicle)
inline

Function to delete a vehicle from this region.

Parameters
vehiclethe vehicle to remove
String [] vanetsim.map.Region.getIntersectionPoints ( Node  mixNode,
Region  region12 
)
inline

Gets intersection points between mix-zone and streets. Before evoking check if this node is a mix-zone. Note that the performance of this function is very bad. It has to be evoked before the start of the simulation!

Returns
string array with to intersection String in form of "x1:x2:x3"
int vanetsim.map.Region.getLeftBoundary ( )
inline

Gets the coordinate of the left boundary of this region.

Returns
the coordinate
int vanetsim.map.Region.getLowerBoundary ( )
inline

Gets the coordinate of the lower boundary of this region.

Returns
the coordinate
Node [] vanetsim.map.Region.getMixZoneNodes ( )
inline

Returns all mix zone nodes in this region.

Returns
an array containing all nodes
Node [] vanetsim.map.Region.getNodes ( )
inline

Returns all nodes in this region.

Returns
an array containing all nodes
int vanetsim.map.Region.getRightBoundary ( )
inline

Gets the coordinate of the right boundary of this region.

Returns
the coordinate
RSU [] vanetsim.map.Region.getRSUs ( )
inline

Returns all Road-Side-Units in this region.

Returns
an array containing all RSUs
Street [] vanetsim.map.Region.getStreets ( )
inline

Returns all streets in this region.

Returns
an array containing all streets
int vanetsim.map.Region.getUpperBoundary ( )
inline

Gets the coordinate of the upper boundary of this region.

Returns
the coordinate
Vehicle [] vanetsim.map.Region.getVehicleArray ( )
inline

Creates an array as a copy of the vehicle ArrayList to prevent problems during simulation caused by changing the ArrayList while reading it in another thread. The array is cached so that new ones are only created when needed.

Returns
the array copy of all vehicles in this region or an empty array if there are no elements
ArrayList<Vehicle> vanetsim.map.Region.getVehicleArrayList ( )
inline

Used to return the ArrayList of all vehicles. Note that it can not guaranteed, that no changes are made after you received this.

Returns
the ArrayList containing all vehicles
int vanetsim.map.Region.getX ( )
inline

Function to get the x axis position of this region.

Returns
x axis position
int vanetsim.map.Region.getY ( )
inline

Function to get the y axis position of this region.

Returns
y axis position
void vanetsim.map.Region.prepareLogs ( Node[]  nodes)
inline

Method to prepare the log files. Calculates all intersections beetween streets and mix-zones


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