VANET Simulator
 All Classes Functions Variables
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
vanetsim.scenario.RSU Class Reference

Public Member Functions

 RSU (int x, int y, int radius, boolean isEncrypted)
 
void sendMessages ()
 
void sendBeacons ()
 
void sendEncryptedBeacons ()
 
final void receiveMessage (int sourceX, int sourceY, Message message)
 
void cleanup (int timePerStep)
 
long getRSUID ()
 
int getX ()
 
int getY ()
 
void setRegion (Region region)
 
Region getRegion ()
 
int getWifiRadius ()
 
int getBeaconCountdown ()
 
int getCommunicationCountdown ()
 
boolean isEncrypted_ ()
 
KnownVehiclesList getKnownVehiclesList_ ()
 

Static Public Member Functions

static void setRegions (Region[][] regions)
 
static void setBeaconsEnabled (boolean state)
 
static void setCommunicationEnabled (boolean state)
 
static void setCommunicationInterval (int communicationInterval)
 
static void setBeaconInterval (int beaconInterval)
 
static void setBeaconMonitorZoneEnabled (boolean beaconMonitorEnabled)
 
static void setMonitoredMixZoneVariables (int beaconMonitorMinX, int beaconMonitorMaxX, int beaconMonitorMinY, int beaconMonitorMaxY)
 
static boolean isShowEncryptedBeaconsInMix_ ()
 
static void setShowEncryptedBeaconsInMix_ (boolean showEncryptedBeaconsInMix_)
 

Static Public Attributes

static ArrayDeque< VehiclecoloredVehicles = new ArrayDeque<Vehicle>()
 
static RSU lastSender = null
 
static boolean colorCleared = false
 

Detailed Description

A Road-Side-Unit to send and receive WiFi signals.

Constructor & Destructor Documentation

vanetsim.scenario.RSU.RSU ( int  x,
int  y,
int  radius,
boolean  isEncrypted 
)
inline

Instantiates a new RSU.

Parameters
xthe x coordinate
ythe y coordinate
radiusthe signal radius
isEncryptedif message is encrypted

Member Function Documentation

void vanetsim.scenario.RSU.cleanup ( int  timePerStep)
inline

Cleanup all outdated messages

Parameters
timePerStepthe actual time per step
int vanetsim.scenario.RSU.getBeaconCountdown ( )
inline

Gets the current beacon countdown

Returns
the beacon countdown
int vanetsim.scenario.RSU.getCommunicationCountdown ( )
inline

Gets the current communication countdown

Returns
the communication countdown
Region vanetsim.scenario.RSU.getRegion ( )
inline

Returns the region the RSU is placed in

Returns
the region
long vanetsim.scenario.RSU.getRSUID ( )
inline
   Resets this rsu so that it can be reused.

public void reset(){

reset countdowns and other variables communicationCountdown_ = 0; knownVehiclesTimeoutCountdown_ = 0; beaconCountdown_ = (int)Math.round(x_)beaconInterval_; communicationCountdown_ = (int)Math.round(x_)communicationInterval_;

reset communication info knownVehiclesList_.clear(); knownMessages_.clear(); } /*

/** Returns the Road-Side-Unit id

Returns
the RSU id
int vanetsim.scenario.RSU.getWifiRadius ( )
inline

Returns the wifi radius

Returns
the wifi radius in cm
int vanetsim.scenario.RSU.getX ( )
inline

Returns the x coordinate of the RSU

Returns
the x coordinate
int vanetsim.scenario.RSU.getY ( )
inline

Returns the y coordinate of the RSU

Returns
the y coordinate
final void vanetsim.scenario.RSU.receiveMessage ( int  sourceX,
int  sourceY,
Message  message 
)
inline

Receive a message from a vehicle.

Parameters
sourceXthe x coordinate of the other vehicle
sourceYthe y coordinate of the other vehicle
messagethe message
void vanetsim.scenario.RSU.sendBeacons ( )
inline

Find vehicles in neighborhood and send beacons to them. Please check the following conditions before calling this function:

  • communication is generally enabled
  • beacons are generally enabled
  • if the beacon countdown is 0 or less
void vanetsim.scenario.RSU.sendEncryptedBeacons ( )
inline

Find vehicles in neighborhood and send beacons to them. Please check the following conditions before calling this function:

  • communication is generally enabled
  • beacons are generally enabled
  • if the beacon countdown is 0 or less
void vanetsim.scenario.RSU.sendMessages ( )
inline

send messages to all vehicles in reach. Uses broadcast, because vehicles cannot send beacons to the RSUs(often to far away)

static void vanetsim.scenario.RSU.setBeaconInterval ( int  beaconInterval)
inlinestatic

Sets a new value for the beacon interval. Common to all Road-Side-Units.

Parameters
beaconIntervalthe new value
static void vanetsim.scenario.RSU.setBeaconMonitorZoneEnabled ( boolean  beaconMonitorEnabled)
inlinestatic

Sets if beacon zones should be monitored or not. Common to all RSUs.

Parameters
beaconMonitorEnabledtrue to enable monitoring mix zones, else false
static void vanetsim.scenario.RSU.setBeaconsEnabled ( boolean  state)
inlinestatic

Sets if beacons are enabled or not. Common to all Road-Side-Units.

Parameters
statetrue to enable beacons, else false
static void vanetsim.scenario.RSU.setCommunicationEnabled ( boolean  state)
inlinestatic

Sets if communication is enabled or not. Common to all Road-Side-Units.

Parameters
statetrue to enable communication, else false
static void vanetsim.scenario.RSU.setCommunicationInterval ( int  communicationInterval)
inlinestatic

Sets a new value for the communication interval. Common to all Road-Side-Units.

Parameters
communicationIntervalthe new value
static void vanetsim.scenario.RSU.setMonitoredMixZoneVariables ( int  beaconMonitorMinX,
int  beaconMonitorMaxX,
int  beaconMonitorMinY,
int  beaconMonitorMaxY 
)
inlinestatic

Sets the values for the monitored beacon zone. A rectangular bounding box within the specified coordinates is monitored if setBeaconMonitorZoneEnabled(boolean) is set to true.

Parameters
beaconMonitorMinXthe minimum x coordinate
beaconMonitorMaxXthe maximum x coordinate
beaconMonitorMinYthe minimum y coordinate
beaconMonitorMaxYthe maximum y coordinate
void vanetsim.scenario.RSU.setRegion ( Region  region)
inline

Sets the region the RSU is placed

Parameters
regionthe region
static void vanetsim.scenario.RSU.setRegions ( Region  regions[][])
inlinestatic

Sets the reference to all regions. Call this on map reload!

Parameters
regionsthe array with all regions

Member Data Documentation

boolean vanetsim.scenario.RSU.colorCleared = false
static

flag to clear vehicle color

ArrayDeque<Vehicle> vanetsim.scenario.RSU.coloredVehicles = new ArrayDeque<Vehicle>()
static

saves all colored vehicles


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