|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvanetsim.scenario.LaneObject
vanetsim.scenario.Vehicle
public final class Vehicle
A vehicle which can move and communicate (if wifi is enabled).
| Field Summary | |
|---|---|
ArrayDeque<WayPoint> |
originalDestinations_
The destinations this vehicle wants to visit. |
| Constructor Summary | |
|---|---|
Vehicle(ArrayDeque<WayPoint> destinations,
int vehicleLength,
int maxSpeed,
int maxCommDist,
boolean wiFiEnabled,
boolean emergencyVehicle,
int brakingRate,
int accelerationRate,
int timeDistance,
int politeness,
java.awt.Color color)
Instantiates a new vehicle. |
|
| Method Summary | |
|---|---|
void |
adjustSpeed(int timePerStep)
Adjust the speed if reaching crossings or other cars. |
boolean |
calculateRoute(boolean careAboutDirection,
boolean isReroute)
(Re-)Calculates the route to the next destination. |
int |
getAccelerationRate()
Gets the acceleration rate |
static AttackRSU[] |
getArsuList()
|
static long |
getAttackedVehicleID_()
|
int |
getBeaconCountdown()
Gets the current beacon countdown |
static int |
getBeaconInterval()
Returns the interval between beacons. |
static boolean |
getbeaconMonitorEnabled()
Gets beacon monitor status |
static int |
getbeaconMonitorMaxX()
Gets beacon monitor maxX coordinate |
static int |
getbeaconMonitorMaxY()
Gets beacon monitor maxY coordinate |
static int |
getbeaconMonitorMinX()
Gets beacon monitor minX coordinate |
static int |
getbeaconMonitorMinY()
Gets beacon monitor minY coordinate |
static boolean |
getBeaconsEnabled()
Signals if beacons are enabled. |
int |
getBrakingRate()
Gets the braking rate |
java.awt.Color |
getColor()
Gets the vehicle color. |
int |
getCommunicationCountdown()
Gets the current communication countdown |
static boolean |
getCommunicationEnabled()
Signals if communication is enabled. |
static int |
getCommunicationInterval()
Returns the interval between messages. |
Node |
getCurMixNode_()
|
int |
getCurWaitTime()
Gets the current wait time |
ArrayDeque<WayPoint> |
getDestinations()
Gets the destinations of this vehicle. |
java.lang.String |
getHexID()
Gets the ID used in beacons encoded in HEX so that it's shorter. |
long |
getID()
Gets the vehicle ID |
int |
getIDsChanged()
Returns how often this vehicle has changed it's ID (excluding the initial ID). |
KnownMessages |
getKnownMessages()
Gets the special data structure with all known messages. |
KnownPenalties |
getKnownPenalties()
Gets the special data structure with all known penalties. |
KnownRSUsList |
getKnownRSUsList()
Gets the special data structure with all known RSUs. |
KnownVehiclesList |
getKnownVehiclesList()
Gets the special data structure with all known vehicles. |
int |
getMaxCommDistance()
Gets the maximum communication distance of this vehicle. |
static int |
getMaximumCommunicationDistance()
Returns the maximum communication distance. |
static int |
getMaxMixZoneRadius()
Gets the maximum mix zone radius used in the scenario. |
int |
getMaxSpeed()
Gets the maximum speed of this vehicle. |
boolean |
getMayBeRecycled()
Indicates if this vehicle may be reset and reused. |
int |
getMessagesCreated()
Returns how many messages this vehicle has created. |
static int |
getMinTravelTimeForRecycling()
Gets the minimum time a vehicle needs to have traveled in order to be able to be recycled. |
static int |
getMixZoneRadius()
Returns the radius of the mix zones. |
static boolean |
getMixZonesEnabled()
Signals if mix zones are enabled. |
static boolean |
getMixZonesFallbackEnabled()
If the fallback mode shall be enabled in mix zones. |
static boolean |
getMixZonesFallbackFloodingOnly()
If the fallback mode only sends messages which are in flooding/broadcast mode. |
int |
getPoliteness()
|
static boolean |
getRecyclingEnabled()
Signals if recycling of vehicles is enabled or not |
int |
getRegionX()
Gets the regions x-coordinate in which this vehicle is found. |
int |
getRegionY()
Gets the regions y-coordinate in which this vehicle is found. |
static ReportingControlPanel |
getREPORT_PANEL()
Gets the report panel for beacon monitoring |
static ReportingControlPanel |
getReportingPanel()
|
boolean[] |
getRouteDirections()
Get the directions corresponding to the array returned getRouteStreets(). |
int |
getRoutePosition()
Gets the current position in the array returned by getRouteStreets() and getRouteDirections(). |
Street[] |
getRouteStreets()
Gets an array with all streets which will be visited until arriving at the next destination. |
static int |
getRoutingMode()
Returns the current routing mode. |
WayPoint |
getStartPoint()
Gets the starting point of the vehicle. |
static int |
getTIME_BETWEEN_SILENT_PERIODS()
|
static int |
getTIME_OF_SILENT_PERIODS()
|
int |
getTimeDistance()
|
long |
getTotalTravelDistance()
The total distance traveled. |
int |
getTotalTravelTime()
Gets how long this vehicle traveled. |
int |
getVehicleID()
Gets the current ID of this vehicle. |
int |
getVehicleLength()
Gets the vehicle length. |
int |
getWaittime()
Gets the current waittime. |
boolean |
isActive()
Returns if this vehicle is currently active. |
static boolean |
isAttackerDataLogged_()
|
static boolean |
isAttackerEncryptedDataLogged_()
|
boolean |
isEmergencyVehicle()
Signals if vehicle is an emergency vehicle |
static boolean |
isEncryptedBeaconsInMix_()
|
boolean |
isInMixZone()
Returns if this vehicle is currently in a mix zone. |
static boolean |
isPrivacyDataLogged_()
|
static boolean |
isSilent_period()
|
static boolean |
isSilentPeriodsOn()
|
boolean |
isWaitingForSignal_()
|
boolean |
isWiFiEnabled()
Returns if this vehicle has WiFi functionality. |
void |
move(int timePerStep)
Move the vehicle one step forward. |
void |
moveAttacker()
Move Attacker. |
void |
receiveMessage(int sourceX,
int sourceY,
Message message)
Receive a message from another vehicle. |
void |
reset()
Resets this vehicle so that it can be reused. |
static void |
resetGlobalRandomGenerator()
Resets the global random number generator |
void |
searchAttackedVehicle_()
The attacked vehicle can«t be found. |
void |
sendBeacons()
Find vehicles in neighborhood and send beacons to them. |
void |
sendEncryptedBeacons()
Find vehicles nearest in neighborhood and send encrypted beacons to them. |
void |
sendMessages()
Find vehicles in neighborhood and give information to them. |
void |
setAccelerationRate(int accelerationRate)
Sets the acceleration rate |
static void |
setArsuList(AttackRSU[] arsuList)
|
static void |
setAttackedVehicleID_(long attackedVehicleID_)
|
static void |
setAttackerDataLogged_(boolean attackerDataLogged_)
|
static void |
setAttackerEncryptedDataLogged_(boolean attackerEncryptedDataLogged_)
|
static void |
setBeaconInterval(int beaconInterval)
Sets a new value for the beacon interval. |
static void |
setBeaconMonitorZoneEnabled(boolean beaconMonitorEnabled)
Sets if beacon zones should be monitored or not. |
static void |
setBeaconsEnabled(boolean state)
Sets if beacons are enabled or not. |
void |
setBrakingRate(int brakingRate)
Sets the braking rate |
void |
setColor(java.awt.Color color)
Sets the color |
static void |
setCommunicationEnabled(boolean state)
Sets if communication is enabled or not. |
static void |
setCommunicationInterval(int communicationInterval)
Sets a new value for the communication interval. |
void |
setCurMixNode_(Node curMixNode_)
|
void |
setCurWaitTime(int curWaitTime)
Sets the current wait time. |
void |
setEmergencyVehicle(boolean emergencyVehicle)
Sets the emergency vehicle mode |
static void |
setEncryptedBeaconsInMix_(boolean encryptedBeaconsInMix_)
|
void |
setMaxCommDistance(int maxCommDistance)
Sets the maximum communication distance |
static void |
setMaximumCommunicationDistance(int maximumCommunicationDistance)
Set the maximum communication distance. |
static void |
setMaxMixZoneRadius(int maxMixZoneRadius)
Set the maximum radius of the mix zones. |
void |
setMaxSpeed(int maxSpeed)
Sets the maximum speed |
static void |
setMinTravelTimeForRecycling(int minTravelTimeForRecycling)
Sets the minimum time a vehicle needs to have traveled in order to be able to be recycled. |
static void |
setMixZoneRadius(int mixZoneRadius)
Set the default radius of the mix zones (in the common settings panel). |
static void |
setMixZonesEnabled(boolean state)
Sets if mix zones are enabled or not. |
static void |
setMixZonesFallbackEnabled(boolean state)
Sets if the fallback mode shall be enabled in mix zones. |
static void |
setMixZonesFallbackFloodingOnly(boolean state)
Sets if the fallback mode only sends messages which are in flooding/broadcast mode. |
static void |
setMonitoredMixZoneVariables(int beaconMonitorMinX,
int beaconMonitorMaxX,
int beaconMonitorMinY,
int beaconMonitorMaxY)
Sets the values for the monitored beacon zone. |
void |
setPoliteness(int politeness_)
|
static void |
setPrivacyDataLogged_(boolean privacyDataLogged_)
|
static void |
setRecyclingEnabled(boolean state)
Sets if recycling of vehicles is enabled or not. |
void |
setRegion(Region region)
Sets the region in which this vehicle is found. |
static void |
setRegions(Region[][] regions)
Sets the reference to all regions. |
static void |
setRoutingMode(int mode)
Sets a new routing mode. |
static void |
setSilent_period(boolean silent_period)
|
static void |
setSilentPeriodsOn(boolean silentPeriodsOn)
|
static void |
setTIME_BETWEEN_SILENT_PERIODS(int i)
|
static void |
setTIME_OF_SILENT_PERIODS(int i)
|
void |
setTimeDistance(int timeDistance)
|
void |
setVehicleLength(int vehicleLength)
Sets the vehicle length |
void |
setWaitingForSignal_(boolean waitingForSignal_)
|
void |
setWiFiEnabled(boolean wiFiEnabled)
Set vehicle WiFi |
java.lang.String |
toString()
Gets a substring of the Vehicle ID. |
| Methods inherited from class vanetsim.scenario.LaneObject |
|---|
getCurDirection, getCurLane, getCurPosition, getCurSpeed, getCurStreet, getNext, getPrevious, getX, getY, setNext, setPrevious |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public ArrayDeque<WayPoint> originalDestinations_
| Constructor Detail |
|---|
public Vehicle(ArrayDeque<WayPoint> destinations,
int vehicleLength,
int maxSpeed,
int maxCommDist,
boolean wiFiEnabled,
boolean emergencyVehicle,
int brakingRate,
int accelerationRate,
int timeDistance,
int politeness,
java.awt.Color color)
throws java.text.ParseException
destinations - an ArrayDeque with at least 2 elements (start and target) indicating where to move.vehicleLength - the vehicle lengthmaxSpeed - the maximum speed of this vehicle in cm/smaxCommDist - the maximum distance in cm this vehicle can communicatewiFiEnabled - true if this vehicle has a communication device (WiFi), else falseemergencyVehicle - true vehicle is an emergency vehiclebrakingRate - the braking rate in cm/s^2accelerationRate - the acceleration rate in cm/s^2color - the color of the vehicle, if empty the default (color.black) is used
java.text.ParseException - an Exception indicating that you did not supply a valid destination list.| Method Detail |
|---|
public boolean calculateRoute(boolean careAboutDirection,
boolean isReroute)
careAboutDirection - true if the direction on the current street shall be used for calculation, false if the direction can be chosen freelyisReroute - 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)public void adjustSpeed(int timePerStep)
timePerStep - the time per step in millisecondspublic void sendMessages()
public final void receiveMessage(int sourceX,
int sourceY,
Message message)
sourceX - the x coordinate of the other vehiclesourceY - the y coordinate of the other vehiclemessage - the messagepublic void sendBeacons()
public void sendEncryptedBeacons()
public void move(int timePerStep)
timePerStep - the time per step in millisecondspublic final void moveAttacker()
public void searchAttackedVehicle_()
public void reset()
public static void resetGlobalRandomGenerator()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean getMayBeRecycled()
true if it may be reused, else falsepublic Street[] getRouteStreets()
public boolean[] getRouteDirections()
getRouteStreets().
public int getRoutePosition()
getRouteStreets() and getRouteDirections().
public int getVehicleID()
public int getCommunicationCountdown()
public int getBeaconCountdown()
public WayPoint getStartPoint()
WayPointpublic int getRegionX()
public int getRegionY()
public int getMaxSpeed()
public int getWaittime()
public ArrayDeque<WayPoint> getDestinations()
ArrayDeque with all destinationspublic int getMaxCommDistance()
public boolean isActive()
true if it's activepublic boolean isInMixZone()
true if it's in a mix zonepublic boolean isWiFiEnabled()
true if it has WiFipublic KnownMessages getKnownMessages()
public KnownPenalties getKnownPenalties()
public KnownVehiclesList getKnownVehiclesList()
public KnownRSUsList getKnownRSUsList()
public int getMessagesCreated()
public int getIDsChanged()
public int getTotalTravelTime()
public long getTotalTravelDistance()
public void setRegion(Region region)
region - the regionpublic java.lang.String getHexID()
public static int getCommunicationInterval()
public static int getBeaconInterval()
public static boolean getCommunicationEnabled()
true if communication is enabled, else falsepublic static boolean getRecyclingEnabled()
true if recycling is enabled, else falsepublic static boolean getBeaconsEnabled()
true if beacons are enabled, else falsepublic static boolean getMixZonesEnabled()
true if mix zones are enabled, else falsepublic static boolean getMixZonesFallbackEnabled()
true if the fallback mode is enabled, else falsepublic static boolean getMixZonesFallbackFloodingOnly()
true if only flooding messages are sent, else falsepublic static int getRoutingMode()
public static int getMaximumCommunicationDistance()
public static int getMinTravelTimeForRecycling()
public static int getMixZoneRadius()
public static void setMaxMixZoneRadius(int maxMixZoneRadius)
maxMixZoneRadius - the maximum radius of the mix zones in cmpublic static int getMaxMixZoneRadius()
public static void setMixZoneRadius(int mixZoneRadius)
mixZoneRadius - the radius of the mix zones in cmpublic static void setMinTravelTimeForRecycling(int minTravelTimeForRecycling)
minTravelTimeForRecycling - the time in millisecondspublic static void setMaximumCommunicationDistance(int maximumCommunicationDistance)
maximumCommunicationDistance - the maximum communication distance in cmpublic static void setRegions(Region[][] regions)
regions - the array with all regionspublic static void setCommunicationInterval(int communicationInterval)
communicationInterval - the new valuepublic static void setBeaconInterval(int beaconInterval)
beaconInterval - the new valuepublic static void setCommunicationEnabled(boolean state)
state - true to enable communication, else falsepublic static void setRecyclingEnabled(boolean state)
state - true to enable recycling, else falsepublic static void setBeaconsEnabled(boolean state)
state - true to enable beacons, else falsepublic static void setMixZonesEnabled(boolean state)
state - true to enable mix zones, else falsepublic static void setMixZonesFallbackEnabled(boolean state)
state - true if the fallback mode is enabled, else falsepublic static void setMixZonesFallbackFloodingOnly(boolean state)
state - true if only flooding messages are sent, else falsepublic static void setBeaconMonitorZoneEnabled(boolean beaconMonitorEnabled)
beaconMonitorEnabled - true to enable monitoring mix zones, else falsepublic static boolean getbeaconMonitorEnabled()
true if beacon monitor is enabled
public static void setMonitoredMixZoneVariables(int beaconMonitorMinX,
int beaconMonitorMaxX,
int beaconMonitorMinY,
int beaconMonitorMaxY)
setBeaconMonitorZoneEnabled(boolean) is set to true.
beaconMonitorMinX - the minimum x coordinatebeaconMonitorMaxX - the maximum x coordinatebeaconMonitorMinY - the minimum y coordinatebeaconMonitorMaxY - the maximum y coordinatepublic static int getbeaconMonitorMinX()
public static int getbeaconMonitorMaxX()
public static int getbeaconMonitorMinY()
public static int getbeaconMonitorMaxY()
public static ReportingControlPanel getREPORT_PANEL()
public static void setRoutingMode(int mode)
mode - the new routing modepublic long getID()
public void setWiFiEnabled(boolean wiFiEnabled)
wiFiEnabled - true to enable WiFi for the vehiclepublic void setMaxSpeed(int maxSpeed)
maxSpeed - the speed in cm/spublic void setMaxCommDistance(int maxCommDistance)
maxCommDistance - the maximum communication distance in cmpublic void setCurWaitTime(int curWaitTime)
curWaitTime - the current wait time in ms.public int getCurWaitTime()
public void setColor(java.awt.Color color)
color - the new colorpublic java.awt.Color getColor()
public void setBrakingRate(int brakingRate)
brakingRate - the braking rate in cm/s^2public int getBrakingRate()
public void setAccelerationRate(int accelerationRate)
accelerationRate - the acceleration rate in cm/s^2public int getAccelerationRate()
public void setEmergencyVehicle(boolean emergencyVehicle)
emergencyVehicle - true to enable emergency modepublic boolean isEmergencyVehicle()
true if vehicle is an emergency vehiclepublic void setVehicleLength(int vehicleLength)
vehicleLength - the vehicle length in cm.public int getVehicleLength()
public static AttackRSU[] getArsuList()
public static void setArsuList(AttackRSU[] arsuList)
public static boolean isAttackerDataLogged_()
public static void setAttackerDataLogged_(boolean attackerDataLogged_)
public static long getAttackedVehicleID_()
public static void setAttackedVehicleID_(long attackedVehicleID_)
public static boolean isEncryptedBeaconsInMix_()
public static void setEncryptedBeaconsInMix_(boolean encryptedBeaconsInMix_)
public static boolean isAttackerEncryptedDataLogged_()
public static void setAttackerEncryptedDataLogged_(boolean attackerEncryptedDataLogged_)
public Node getCurMixNode_()
public void setCurMixNode_(Node curMixNode_)
public static ReportingControlPanel getReportingPanel()
public boolean isWaitingForSignal_()
public void setWaitingForSignal_(boolean waitingForSignal_)
waitingForSignal_ - the waitingForSignal_ to setpublic static boolean isPrivacyDataLogged_()
public static void setPrivacyDataLogged_(boolean privacyDataLogged_)
public void setTimeDistance(int timeDistance)
public int getTimeDistance()
public void setPoliteness(int politeness_)
public int getPoliteness()
public static int getTIME_BETWEEN_SILENT_PERIODS()
public static void setTIME_BETWEEN_SILENT_PERIODS(int i)
public static int getTIME_OF_SILENT_PERIODS()
public static void setTIME_OF_SILENT_PERIODS(int i)
public static boolean isSilent_period()
public static void setSilent_period(boolean silent_period)
public static boolean isSilentPeriodsOn()
public static void setSilentPeriodsOn(boolean silentPeriodsOn)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||