vanetsim.scenario.messages
Class PenaltyMessage

java.lang.Object
  extended by vanetsim.scenario.messages.Message
      extended by vanetsim.scenario.messages.PenaltyMessage

public class PenaltyMessage
extends Message

A message which indicates some kind of traffic jam through assigning a penalty to the street on which the jam is.


Constructor Summary
PenaltyMessage(int destinationX, int destinationY, int destinationRadius, int validUntil, Street penaltyStreet, int penaltyDirection, int penaltyValue, int penaltyValidUntil)
          Instantiates a new penalty message.
 
Method Summary
 void execute(Vehicle vehicle)
          Executes the message by adding a new penalty value to the known penalties of the vehicle given.
 
Methods inherited from class vanetsim.scenario.messages.Message
getDestinationRadius, getDestinationRadiusSquared, getDestinationX_, getDestinationY_, getFloodingMode, isValid, setFloodingMode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PenaltyMessage

public PenaltyMessage(int destinationX,
                      int destinationY,
                      int destinationRadius,
                      int validUntil,
                      Street penaltyStreet,
                      int penaltyDirection,
                      int penaltyValue,
                      int penaltyValidUntil)
Instantiates a new penalty message.

Parameters:
destinationX - the x coordinate of the destination of the message
destinationY - the y coordinate of the destination of the message
destinationRadius - the radius of the destination area in cm
validUntil - how long the message is valid in ms (measured from simulation start)
penaltyStreet - the penalty street
penaltyDirection - the direction to which the penalty corresponds. 1 means from endNode to startNode, 0 means both directions and -1 means from startNode to endNode
penaltyValue - the penalty value in cm
penaltyValidUntil - how long the penalty is valid in ms (measured from simulation start)
Method Detail

execute

public void execute(Vehicle vehicle)
Executes the message by adding a new penalty value to the known penalties of the vehicle given.

Specified by:
execute in class Message
Parameters:
vehicle - the vehicle on which this operation is done
See Also:
Message.execute(vanetsim.scenario.Vehicle)