Public Member Functions | |
Vehicle (ArrayDeque< WayPoint > destinations, int vehicleLength, int maxSpeed, int maxCommDist, boolean wiFiEnabled, boolean emergencyVehicle, int brakingRate, int accelerationRate, int timeDistance, int politeness, Color color) throws ParseException | |
boolean | calculateRoute (boolean careAboutDirection, boolean isReroute) |
void | adjustSpeed (int timePerStep) |
void | sendMessages () |
final void | receiveMessage (int sourceX, int sourceY, Message message) |
void | sendBeacons () |
void | sendEncryptedBeacons () |
void | move (int timePerStep) |
final void | moveAttacker () |
void | searchAttackedVehicle_ () |
void | reset () |
String | toString () |
boolean | getMayBeRecycled () |
Street[] | getRouteStreets () |
boolean[] | getRouteDirections () |
int | getRoutePosition () |
int | getVehicleID () |
int | getCommunicationCountdown () |
int | getBeaconCountdown () |
WayPoint | getStartPoint () |
int | getRegionX () |
int | getRegionY () |
int | getMaxSpeed () |
int | getWaittime () |
ArrayDeque< WayPoint > | getDestinations () |
int | getMaxCommDistance () |
boolean | isActive () |
boolean | isInMixZone () |
boolean | isWiFiEnabled () |
KnownMessages | getKnownMessages () |
KnownPenalties | getKnownPenalties () |
KnownVehiclesList | getKnownVehiclesList () |
KnownRSUsList | getKnownRSUsList () |
int | getMessagesCreated () |
int | getIDsChanged () |
int | getTotalTravelTime () |
long | getTotalTravelDistance () |
void | setRegion (Region region) |
String | getHexID () |
long | getID () |
void | setWiFiEnabled (boolean wiFiEnabled) |
void | setMaxSpeed (int maxSpeed) |
void | setMaxCommDistance (int maxCommDistance) |
void | setCurWaitTime (int curWaitTime) |
int | getCurWaitTime () |
void | setColor (Color color) |
Color | getColor () |
void | setBrakingRate (int brakingRate) |
int | getBrakingRate () |
void | setAccelerationRate (int accelerationRate) |
int | getAccelerationRate () |
void | setEmergencyVehicle (boolean emergencyVehicle) |
boolean | isEmergencyVehicle () |
void | setVehicleLength (int vehicleLength) |
int | getVehicleLength () |
Node | getCurMixNode_ () |
void | setCurMixNode_ (Node curMixNode_) |
boolean | isWaitingForSignal_ () |
void | setWaitingForSignal_ (boolean waitingForSignal_) |
void | setTimeDistance (int timeDistance) |
int | getTimeDistance () |
void | setPoliteness (int politeness_) |
int | getPoliteness () |
Public Member Functions inherited from vanetsim.scenario.LaneObject | |
int | getX () |
int | getY () |
int | getCurSpeed () |
double | getCurPosition () |
int | getCurLane () |
Street | getCurStreet () |
boolean | getCurDirection () |
LaneObject | getNext () |
LaneObject | getPrevious () |
void | setNext (LaneObject next) |
void | setPrevious (LaneObject previous) |
Static Public Member Functions | |
static void | resetGlobalRandomGenerator () |
static int | getCommunicationInterval () |
static int | getBeaconInterval () |
static boolean | getCommunicationEnabled () |
static boolean | getRecyclingEnabled () |
static boolean | getBeaconsEnabled () |
static boolean | getMixZonesEnabled () |
static boolean | getMixZonesFallbackEnabled () |
static boolean | getMixZonesFallbackFloodingOnly () |
static int | getRoutingMode () |
static int | getMaximumCommunicationDistance () |
static int | getMinTravelTimeForRecycling () |
static int | getMixZoneRadius () |
static void | setMaxMixZoneRadius (int maxMixZoneRadius) |
static int | getMaxMixZoneRadius () |
static void | setMixZoneRadius (int mixZoneRadius) |
static void | setMinTravelTimeForRecycling (int minTravelTimeForRecycling) |
static void | setMaximumCommunicationDistance (int maximumCommunicationDistance) |
static void | setRegions (Region[][] regions) |
static void | setCommunicationInterval (int communicationInterval) |
static void | setBeaconInterval (int beaconInterval) |
static void | setCommunicationEnabled (boolean state) |
static void | setRecyclingEnabled (boolean state) |
static void | setBeaconsEnabled (boolean state) |
static void | setMixZonesEnabled (boolean state) |
static void | setMixZonesFallbackEnabled (boolean state) |
static void | setMixZonesFallbackFloodingOnly (boolean state) |
static void | setBeaconMonitorZoneEnabled (boolean beaconMonitorEnabled) |
static boolean | getbeaconMonitorEnabled () |
static void | setMonitoredMixZoneVariables (int beaconMonitorMinX, int beaconMonitorMaxX, int beaconMonitorMinY, int beaconMonitorMaxY) |
static int | getbeaconMonitorMinX () |
static int | getbeaconMonitorMaxX () |
static int | getbeaconMonitorMinY () |
static int | getbeaconMonitorMaxY () |
static ReportingControlPanel | getREPORT_PANEL () |
static void | setRoutingMode (int mode) |
static AttackRSU[] | getArsuList () |
static void | setArsuList (AttackRSU[] arsuList) |
static boolean | isAttackerDataLogged_ () |
static void | setAttackerDataLogged_ (boolean attackerDataLogged_) |
static long | getAttackedVehicleID_ () |
static void | setAttackedVehicleID_ (long attackedVehicleID_) |
static boolean | isEncryptedBeaconsInMix_ () |
static void | setEncryptedBeaconsInMix_ (boolean encryptedBeaconsInMix_) |
static boolean | isAttackerEncryptedDataLogged_ () |
static void | setAttackerEncryptedDataLogged_ (boolean attackerEncryptedDataLogged_) |
static ReportingControlPanel | getReportingPanel () |
static boolean | isPrivacyDataLogged_ () |
static void | setPrivacyDataLogged_ (boolean privacyDataLogged_) |
static int | getTIME_BETWEEN_SILENT_PERIODS () |
static void | setTIME_BETWEEN_SILENT_PERIODS (int i) |
static int | getTIME_OF_SILENT_PERIODS () |
static void | setTIME_OF_SILENT_PERIODS (int i) |
static boolean | isSilent_period () |
static void | setSilent_period (boolean silent_period) |
static boolean | isSilentPeriodsOn () |
static void | setSilentPeriodsOn (boolean silentPeriodsOn) |
Public Attributes | |
ArrayDeque< WayPoint > | originalDestinations_ |
Additional Inherited Members | |
Protected Member Functions inherited from vanetsim.scenario.LaneObject | |
void | calculatePosition () |
Protected Attributes inherited from vanetsim.scenario.LaneObject | |
LaneObject | previous_ |
LaneObject | next_ |
int | curX_ |
int | curY_ |
double | curSpeed_ = 0.0 |
double | curPosition_ |
int | curLane_ = 1 |
Street | curStreet_ |
boolean | curDirection_ = true |
A vehicle which can move and communicate (if wifi is enabled).
|
inline |
Instantiates a new vehicle. You will get an exception if the destinations don't contain at least two valid elements.
Elements are considered as invalid if
destinations | an ArrayDeque with at least 2 elements (start and target) indicating where to move. |
vehicleLength | the vehicle length |
maxSpeed | the maximum speed of this vehicle in cm/s |
maxCommDist | the maximum distance in cm this vehicle can communicate |
wiFiEnabled | true if this vehicle has a communication device (WiFi), else false |
emergencyVehicle | true vehicle is an emergency vehicle |
brakingRate | the braking rate in cm/s^2 |
accelerationRate | the acceleration rate in cm/s^2 |
color | the color of the vehicle, if empty the default (color.black) is used |
ParseException | an Exception indicating that you did not supply a valid destination list. |
|
inline |
Adjust the speed if reaching crossings or other cars. It also checks if the vehicle should get active. Furthermore some cleanup in the known messages and vehicles is done and new jam messages are created if necessary.
timePerStep | the time per step in milliseconds |
|
inline |
(Re-)Calculates the route to the next destination.
careAboutDirection | true if the direction on the current street shall be used for calculation, false if the direction can be chosen freely |
isReroute | true to indicate that this is a Rerouting. If it's a rerouting, a non-existent route does not lead to the vehicle getting inactive! |
true
if new route has been found, else false
(on error)
|
inline |
Gets the acceleration rate
|
inline |
Gets the current beacon countdown
|
inlinestatic |
Returns the interval between beacons.
|
inlinestatic |
Gets beacon monitor status
true
if beacon monitor is enabled
|
inlinestatic |
Gets beacon monitor maxX coordinate
|
inlinestatic |
Gets beacon monitor maxY coordinate
|
inlinestatic |
Gets beacon monitor minX coordinate
|
inlinestatic |
Gets beacon monitor minY coordinate
|
inlinestatic |
Signals if beacons are enabled.
true
if beacons are enabled, else false
|
inline |
Gets the braking rate
|
inline |
Gets the vehicle color.
|
inline |
Gets the current communication countdown
|
inlinestatic |
Signals if communication is enabled.
true
if communication is enabled, else false
|
inlinestatic |
Returns the interval between messages.
|
inline |
Gets the current wait time
|
inline |
Gets the destinations of this vehicle.
ArrayDeque
with all destinations
|
inline |
Gets the ID used in beacons encoded in HEX so that it's shorter. If the vehicle is not wifi enabled, brackets are used to indicate this.
|
inline |
Gets the vehicle ID
|
inline |
Returns how often this vehicle has changed it's ID (excluding the initial ID).
|
inline |
Gets the special data structure with all known messages.
|
inline |
Gets the special data structure with all known penalties.
|
inline |
Gets the special data structure with all known RSUs.
|
inline |
Gets the special data structure with all known vehicles.
|
inline |
Gets the maximum communication distance of this vehicle.
|
inlinestatic |
Returns the maximum communication distance.
|
inlinestatic |
Gets the maximum mix zone radius used in the scenario.
|
inline |
Gets the maximum speed of this vehicle.
|
inline |
Indicates if this vehicle may be reset and reused.
true
if it may be reused, else false
|
inline |
Returns how many messages this vehicle has created.
|
inlinestatic |
Gets the minimum time a vehicle needs to have traveled in order to be able to be recycled. Vehicles which travel shorter than this time will NOT get recycled.
|
inlinestatic |
Returns the radius of the mix zones.
|
inlinestatic |
Signals if mix zones are enabled.
true
if mix zones are enabled, else false
|
inlinestatic |
If the fallback mode shall be enabled in mix zones. This fallback mode enables the beaconless communication inside mix zones.
true
if the fallback mode is enabled, else false
|
inlinestatic |
If the fallback mode only sends messages which are in flooding/broadcast mode.
true
if only flooding messages are sent, else false
|
inlinestatic |
Signals if recycling of vehicles is enabled or not
true
if recycling is enabled, else false
|
inline |
Gets the regions x-coordinate in which this vehicle is found.
|
inline |
Gets the regions y-coordinate in which this vehicle is found.
|
inlinestatic |
Gets the report panel for beacon monitoring
|
inline |
Get the directions corresponding to the array returned getRouteStreets()
.
|
inline |
Gets the current position in the array returned by getRouteStreets()
and getRouteDirections()
.
|
inline |
Gets an array with all streets which will be visited until arriving at the next destination.
|
inlinestatic |
Returns the current routing mode.
|
inline |
Gets the starting point of the vehicle.
WayPoint
|
inline |
The total distance traveled. This is not completely exact but should suffice in most cases. Small aberration from the real value occur if this vehicle reaches a destination (which should not happen too often).
|
inline |
Gets how long this vehicle traveled. This excludes predefined waiting times but includes all other stops.
|
inline |
Gets the current ID of this vehicle. This ID might change if mixing is enabled!
|
inline |
Gets the vehicle length.
|
inline |
Gets the current waittime.
|
inline |
Returns if this vehicle is currently active.
true
if it's active
|
inline |
Signals if vehicle is an emergency vehicle
true
if vehicle is an emergency vehicle
|
inline |
Returns if this vehicle is currently in a mix zone.
true
if it's in a mix zone
|
inline |
|
inline |
Returns if this vehicle has WiFi functionality.
true
if it has WiFi
|
inline |
Move the vehicle one step forward. Please check if the vehicle is active before calling this!
timePerStep | the time per step in milliseconds |
|
inline |
Move Attacker.
|
inline |
Receive a message from another vehicle.
sourceX | the x coordinate of the other vehicle |
sourceY | the y coordinate of the other vehicle |
message | the message |
|
inline |
Resets this vehicle so that it can be reused. It will travel on the same route as last time!
|
inlinestatic |
Resets the global random number generator
|
inline |
The attacked vehicle can«t be found. But it can«t be far because we received a beacon the last time. This method is only evoked one time per mix-zone so it doesn't need to be that efficient
|
inline |
Find vehicles in neighborhood and send beacons to them. Please check the following conditions before calling this function:
|
inline |
Find vehicles nearest in neighborhood and send encrypted beacons to them. Please check the following conditions before calling this function:
|
inline |
Find vehicles in neighborhood and give information to them. Please check the following conditions before calling this function:
|
inline |
Sets the acceleration rate
accelerationRate | the acceleration rate in cm/s^2 |
|
inlinestatic |
Sets a new value for the beacon interval. Common to all vehicles.
beaconInterval | the new value |
|
inlinestatic |
Sets if beacon zones should be monitored or not. Common to all vehicles.
beaconMonitorEnabled | true to enable monitoring mix zones, else false |
|
inlinestatic |
Sets if beacons are enabled or not. Common to all vehicles.
state | true to enable beacons, else false |
|
inline |
Sets the braking rate
brakingRate | the braking rate in cm/s^2 |
|
inline |
Sets the color
color | the new color |
|
inlinestatic |
Sets if communication is enabled or not. Common to all vehicles.
state | true to enable communication, else false |
|
inlinestatic |
Sets a new value for the communication interval. Common to all vehicles.
communicationInterval | the new value |
|
inline |
Sets the current wait time.
curWaitTime | the current wait time in ms. |
|
inline |
Sets the emergency vehicle mode
emergencyVehicle | true to enable emergency mode |
|
inline |
Sets the maximum communication distance
maxCommDistance | the maximum communication distance in cm |
|
inlinestatic |
Set the maximum communication distance.
maximumCommunicationDistance | the maximum communication distance in cm |
|
inlinestatic |
Set the maximum radius of the mix zones.
maxMixZoneRadius | the maximum radius of the mix zones in cm |
|
inline |
Sets the maximum speed
maxSpeed | the speed in cm/s |
|
inlinestatic |
Sets the minimum time a vehicle needs to have traveled in order to be able to be recycled. Vehicles which travel shorter than this time will NOT get recycled.
minTravelTimeForRecycling | the time in milliseconds |
|
inlinestatic |
Set the default radius of the mix zones (in the common settings panel).
mixZoneRadius | the radius of the mix zones in cm |
|
inlinestatic |
Sets if mix zones are enabled or not. Common to all vehicles.
state | true to enable mix zones, else false |
|
inlinestatic |
Sets if the fallback mode shall be enabled in mix zones. This fallback mode enables the beaconless communication inside mix zones.
state | true if the fallback mode is enabled, else false |
|
inlinestatic |
Sets if the fallback mode only sends messages which are in flooding/broadcast mode.
state | true if only flooding messages are sent, else false |
|
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
.
beaconMonitorMinX | the minimum x coordinate |
beaconMonitorMaxX | the maximum x coordinate |
beaconMonitorMinY | the minimum y coordinate |
beaconMonitorMaxY | the maximum y coordinate |
|
inlinestatic |
Sets if recycling of vehicles is enabled or not. Common to all vehicles.
state | true to enable recycling, else false |
|
inline |
Sets the region in which this vehicle is found.
region | the region |
|
inlinestatic |
Sets the reference to all regions. Call this on map reload!
regions | the array with all regions |
|
inlinestatic |
Sets a new routing mode. See the A_Star_Algor for details. Common to all vehicles.
mode | the new routing mode |
|
inline |
Sets the vehicle length
vehicleLength | the vehicle length in cm. |
|
inline |
waitingForSignal_ | the waitingForSignal_ to set |
|
inline |
Set vehicle WiFi
wiFiEnabled | true to enable WiFi for the vehicle |
|
inline |
Gets a substring of the Vehicle ID. Used in the EditOneVehicleControl.java chooseVehicle_ JCombobox.
ArrayDeque<WayPoint> vanetsim.scenario.Vehicle.originalDestinations_ |
The destinations this vehicle wants to visit.