jist.swans.net
Class PacketLoss.Uniform

java.lang.Object
  extended by jist.swans.net.PacketLoss.Uniform
All Implemented Interfaces:
PacketLoss
Enclosing interface:
PacketLoss

public static class PacketLoss.Uniform
extends java.lang.Object
implements PacketLoss

Uniformly random packet loss.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.net.PacketLoss
PacketLoss.Uniform, PacketLoss.Zero
 
Constructor Summary
PacketLoss.Uniform(double prob)
          Initialize uniform packet loss model.
 
Method Summary
 boolean shouldDrop(NetMessage msg)
          Decide whether to drop a packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketLoss.Uniform

public PacketLoss.Uniform(double prob)
Initialize uniform packet loss model.

Parameters:
prob - packet loss probability
Method Detail

shouldDrop

public boolean shouldDrop(NetMessage msg)
Decide whether to drop a packet.

Specified by:
shouldDrop in interface PacketLoss
Parameters:
msg - message being processed
Returns:
whether packet should be dropped