vanetsim.scenario.messages
Class Message

java.lang.Object
  extended by vanetsim.scenario.messages.Message
Direct Known Subclasses:
PenaltyMessage

public abstract class Message
extends java.lang.Object

An abstract class for messages.


Constructor Summary
Message()
           
 
Method Summary
abstract  void execute(Vehicle vehicle)
          Executes something on a vehicle given.
 int getDestinationRadius()
          Gets the destination radius.
 long getDestinationRadiusSquared()
          Gets the squared destination radius.
 int getDestinationX_()
          Gets the x coordinate of the destination.
 int getDestinationY_()
          Gets the y coordinate of the destination.
 boolean getFloodingMode()
          Returns if flooding mode is enabled on this message
 boolean isValid()
          Checks if the message is still valid.
 void setFloodingMode(boolean mode)
          Sets if flooding mode is enabled on this message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message()
Method Detail

isValid

public boolean isValid()
Checks if the message is still valid.

Returns:
true if it's valid, else false

getDestinationX_

public int getDestinationX_()
Gets the x coordinate of the destination.

Returns:
the x destination

getDestinationY_

public int getDestinationY_()
Gets the y coordinate of the destination.

Returns:
the y destination

getFloodingMode

public boolean getFloodingMode()
Returns if flooding mode is enabled on this message

Returns:
true if flooding of this message to all vehicles is done, false if line-forwarding is done

setFloodingMode

public void setFloodingMode(boolean mode)
Sets if flooding mode is enabled on this message

Parameters:
mode - true if flooding of this message to all vehicles is done, false if line-forwarding is done

getDestinationRadius

public int getDestinationRadius()
Gets the destination radius. If the message arrives in this circular destination area, it should be broadcasted to all vehicles.

Returns:
the tolerance in cm

getDestinationRadiusSquared

public long getDestinationRadiusSquared()
Gets the squared destination radius.

Returns:
the squared radius of the destination region in cm^2

execute

public abstract void execute(Vehicle vehicle)
Executes something on a vehicle given.

Parameters:
vehicle - the vehicle