|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.tudelft.ewi.alg.distsim.net.RandomDelay
public class RandomDelay
Simulator for a non-lossy network with uniform random latency between two bounds.
Field Summary |
---|
Fields inherited from interface nl.tudelft.ewi.alg.distsim.net.NetSimulator |
---|
LOST |
Constructor Summary | |
---|---|
RandomDelay(java.util.Random rnd,
int minMS,
int maxMS)
Construct a new instance with the specified bounds. |
Method Summary | |
---|---|
long |
send(int senderID,
int receiverID,
long sendTime)
Simulate the sending of a message m by giving the message's delivery time, possibly losing it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomDelay(java.util.Random rnd, int minMS, int maxMS)
rnd
- Random number generatorminMS
- Minimum delay in millisecondsmaxMS
- Maximum delay in millisecondsMethod Detail |
---|
public long send(int senderID, int receiverID, long sendTime)
send
in interface NetSimulator
senderID
- sender of the messagereceiverID
- receiver of the messagesendTime
- clock time (in nanoseconds) when the message was sent
NetSimulator.LOST
if lost
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |