peersim.edsim
Class RandNextCycle

java.lang.Object
  extended by peersim.edsim.NextCycleEvent
      extended by peersim.edsim.RandNextCycle
All Implemented Interfaces:
java.lang.Cloneable

public class RandNextCycle
extends NextCycleEvent

Implements random delay between calling the nextCycle method of the protocol.

See Also:
nextDelay(long)

Constructor Summary
RandNextCycle(java.lang.String n)
          Calls super constructor.
 
Method Summary
 java.lang.Object clone()
          Calls super.clone().
protected  long nextDelay(long step)
          Returns a random delay with uniform distribution between 1 (inclusive) and 2*step (exclusive) (expected value is therefore step).
 
Methods inherited from class peersim.edsim.NextCycleEvent
execute
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandNextCycle

public RandNextCycle(java.lang.String n)
Calls super constructor.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Calls super.clone().

Overrides:
clone in class NextCycleEvent
Throws:
java.lang.CloneNotSupportedException

nextDelay

protected long nextDelay(long step)
Returns a random delay with uniform distribution between 1 (inclusive) and 2*step (exclusive) (expected value is therefore step).

Overrides:
nextDelay in class NextCycleEvent