vanetsim.scenario.messages
Class PenaltyMessage
java.lang.Object
vanetsim.scenario.messages.Message
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 messagedestinationY
- the y coordinate of the destination of the messagedestinationRadius
- the radius of the destination area in cmvalidUntil
- how long the message is valid in ms (measured from simulation start)penaltyStreet
- the penalty streetpenaltyDirection
- the direction to which the penalty corresponds. 1
means from endNode to startNode,
0
means both directions and -1
means from startNode to endNodepenaltyValue
- the penalty value in cmpenaltyValidUntil
- how long the penalty is valid in ms (measured from simulation start)
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)