|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.tudelft.ewi.alg.distsim.net.SimpleDelay
public class SimpleDelay
Simulator for a non-lossy network with a fixed message latency.
Nested Class Summary | |
---|---|
static class |
SimpleDelay.Unit
Units for specifying message latency. |
Field Summary | |
---|---|
long |
delay
|
Fields inherited from interface nl.tudelft.ewi.alg.distsim.net.NetSimulator |
---|
LOST |
Constructor Summary | |
---|---|
SimpleDelay(long delay)
Construct a SimpleDelay instance |
|
SimpleDelay(long delay,
SimpleDelay.Unit unit)
Construct a SimpleDelay instance |
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 |
Field Detail |
---|
public final long delay
Constructor Detail |
---|
public SimpleDelay(long delay)
delay
- The (non-negative) delay for delivering messages, in milliseconds.public SimpleDelay(long delay, SimpleDelay.Unit unit)
delay
- The (non-negative) delay for delivering messages.unit
- the time unit in which the delay has been specifiedMethod 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 |