|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vanetsim.map.Region
public final class Region
A region stores all objects in a specific part of the map. It stores streets, nodes and vehicles.
Field Summary | |
---|---|
java.util.ArrayList<java.lang.String> |
nnn
|
java.util.ArrayList<java.lang.String> |
xxx
|
java.util.ArrayList<java.lang.String> |
yyy
|
Constructor Summary | |
---|---|
Region(int x,
int y,
int leftBoundary,
int rightBoundary,
int upperBoundary,
int lowerBoundary)
Constructor for a region. |
Method Summary | |
---|---|
void |
addMixZone(Node node,
int radius)
adds mix zone at the location of "node" if no mix zone on this location already exists |
Node |
addNode(Node node,
boolean doCheck)
Function to add a node to this region. |
void |
addRSU(RSU rsu)
Function to add a Road-Side-Units to this region. |
void |
addStreet(Street street,
boolean doCheck)
Function to add a street to this region. |
void |
addVehicle(Vehicle vehicle,
boolean doCheck)
Function to add a vehicle to this region. |
void |
calculateJunctions()
This function should be called before starting simulation. |
void |
checkStreetsForBridges()
Checks all streets in this region for possible bridges. |
void |
cleanVehicles()
This function should be called before initializing a new scenario to delete all vehicles. |
void |
clearMixZones()
clear all mix zones from this region. |
void |
clearRSUs()
clear all RSUs from this region. |
void |
clearTrafficLights()
This function deletes all traffic lights in this region |
void |
createBacklink(WorkerThread thread,
int numberinThread)
Creates a backlink to the worker thread which computes this region. |
void |
deleteMixZone(Node node)
deletes mix zone at the node |
void |
delNode(Node node)
Delete a node. |
void |
delRSU(RSU rsu)
Delete a Road-Side-Unit. |
void |
delStreet(Street street)
Delete a street. |
void |
delVehicle(Vehicle vehicle)
Function to delete a vehicle from this region. |
java.lang.String[] |
getIntersectionPoints(Node mixNode,
Region region12)
Gets intersection points between mix-zone and streets. |
int |
getLeftBoundary()
Gets the coordinate of the left boundary of this region. |
int |
getLowerBoundary()
Gets the coordinate of the lower boundary of this region. |
Node[] |
getMixZoneNodes()
Returns all mix zone nodes in this region. |
Node[] |
getNodes()
Returns all nodes in this region. |
int |
getRightBoundary()
Gets the coordinate of the right boundary of this region. |
RSU[] |
getRSUs()
Returns all Road-Side-Units in this region. |
Street[] |
getStreets()
Returns all streets in this region. |
int |
getUpperBoundary()
Gets the coordinate of the upper boundary of this region. |
Vehicle[] |
getVehicleArray()
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. |
java.util.ArrayList<Vehicle> |
getVehicleArrayList()
Used to return the ArrayList of all vehicles. |
int |
getX()
Function to get the x axis position of this region. |
int |
getY()
Function to get the y axis position of this region. |
void |
prepareLogs(Node[] nodes)
Method to prepare the log files. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.ArrayList<java.lang.String> xxx
public java.util.ArrayList<java.lang.String> yyy
public java.util.ArrayList<java.lang.String> nnn
Constructor Detail |
---|
public Region(int x, int y, int leftBoundary, int rightBoundary, int upperBoundary, int lowerBoundary)
x
- the position on the x axis of the new regiony
- the position on the y axis of the new regionleftBoundary
- the coordinate of the left boundaryrightBoundary
- the coordinate of the right boundaryupperBoundary
- the coordinate of the upper boundarylowerBoundary
- the coordinate of the lower boundaryMethod Detail |
---|
public Node addNode(Node node, boolean doCheck)
node
- the node to adddoCheck
- true
if a check should be made if this node already exists; else false
to skip the test
node
if it already existed and check
was true)public void delNode(Node node)
node
- the nodepublic void addRSU(RSU rsu)
rsu
- the RSU to addpublic void delRSU(RSU rsu)
rsu
- the RSU to deletepublic void addStreet(Street street, boolean doCheck)
street
- the street to adddoCheck
- true
if a check should be made if this street already exists; else false
to skip the testpublic void checkStreetsForBridges()
public void delStreet(Street street)
street
- the streetpublic void addVehicle(Vehicle vehicle, boolean doCheck)
vehicle
- vehicle to adddoCheck
- true
if a check should be made if this vehicle already exists; else false
to skip the testpublic void delVehicle(Vehicle vehicle)
vehicle
- the vehicle to removepublic int getX()
public int getY()
public void calculateJunctions()
public void addMixZone(Node node, int radius)
public void deleteMixZone(Node node)
node
- Node where mix zone is placed onpublic void prepareLogs(Node[] nodes)
public java.lang.String[] getIntersectionPoints(Node mixNode, Region region12)
public void clearMixZones()
public void clearRSUs()
public void cleanVehicles()
public void clearTrafficLights()
public Node[] getNodes()
public Node[] getMixZoneNodes()
public RSU[] getRSUs()
public Street[] getStreets()
public java.util.ArrayList<Vehicle> getVehicleArrayList()
ArrayList
of all vehicles. Note that it can not guaranteed, that no
changes are made after you received this.
ArrayList
containing all vehiclespublic Vehicle[] getVehicleArray()
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.
public void createBacklink(WorkerThread thread, int numberinThread)
thread
- the threadnumberinThread
- the number in the threadpublic int getLeftBoundary()
public int getRightBoundary()
public int getUpperBoundary()
public int getLowerBoundary()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |