|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.direct.NetworkSimulatorImpl<Identifier,MessageType>
public class NetworkSimulatorImpl<Identifier,MessageType>
Field Summary | |
---|---|
protected ProximityGenerator |
generator
|
protected LivenessProvider<Identifier> |
livenessProvider
|
protected RandomSource |
random
|
protected BasicNetworkSimulator<Identifier,MessageType> |
simulator
|
Constructor Summary | |
---|---|
NetworkSimulatorImpl(Environment env,
ProximityGenerator generator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BasicNetworkSimulator<Identifier,MessageType> simulator
protected RandomSource random
protected ProximityGenerator generator
protected LivenessProvider<Identifier> livenessProvider
Constructor Detail |
---|
public NetworkSimulatorImpl(Environment env, ProximityGenerator generator)
Method Detail |
---|
public Environment getEnvironment()
getEnvironment
in interface NetworkSimulator<Identifier,MessageType>
public void setFullSpeed()
NetworkSimulator
setFullSpeed
in interface NetworkSimulator<Identifier,MessageType>
public void setMaxSpeed(float rate)
NetworkSimulator
setMaxSpeed
in interface NetworkSimulator<Identifier,MessageType>
public void start()
start
in interface NetworkSimulator<Identifier,MessageType>
public void stop()
stop
in interface NetworkSimulator<Identifier,MessageType>
public TestRecord getTestRecord()
getTestRecord
in interface NetworkSimulator<Identifier,MessageType>
public void setTestRecord(TestRecord tr)
setTestRecord
in interface NetworkSimulator<Identifier,MessageType>
tr
- input TestRecordpublic boolean addSimulatorListener(GenericSimulatorListener<Identifier,MessageType> sl)
addSimulatorListener
in interface NetworkSimulator<Identifier,MessageType>
public boolean removeSimulatorListener(GenericSimulatorListener<Identifier,MessageType> sl)
removeSimulatorListener
in interface NetworkSimulator<Identifier,MessageType>
public void notifySimulatorListenersSent(MessageType m, Identifier from, Identifier to, int delay)
NetworkSimulator
notifySimulatorListenersSent
in interface NetworkSimulator<Identifier,MessageType>
m
- the messagefrom
- the sourceto
- the destinationdelay
- the network proximity (when the message will be received)public void notifySimulatorListenersReceived(MessageType m, Identifier from, Identifier to)
NetworkSimulator
notifySimulatorListenersReceived
in interface NetworkSimulator<Identifier,MessageType>
m
- the messagefrom
- the sourceto
- the destinationpublic void destroy(DirectPastryNode dpn)
destroy
in interface NetworkSimulator<Identifier,MessageType>
public CancellableTask enqueueDelivery(Delivery del, int delay)
NetworkSimulator
enqueueDelivery
in interface NetworkSimulator<Identifier,MessageType>
public NodeRecord generateNodeRecord()
NetworkSimulator
generateNodeRecord
in interface NetworkSimulator<Identifier,MessageType>
public DirectNodeHandle getClosest(DirectNodeHandle nh)
NetworkSimulator
getClosest
in interface NetworkSimulator<Identifier,MessageType>
public boolean isAlive(Identifier nh)
NetworkSimulator
isAlive
in interface NetworkSimulator<Identifier,MessageType>
public float networkDelay(Identifier a, Identifier b)
NetworkSimulator
networkDelay
in interface NetworkSimulator<Identifier,MessageType>
a
- a node id.b
- another node id.
public float proximity(Identifier a, Identifier b)
NetworkSimulator
proximity
in interface NetworkSimulator<Identifier,MessageType>
a
- a node id.b
- another node id.
public void removeNode(PastryNode node)
NetworkSimulator
removeNode
in interface NetworkSimulator<Identifier,MessageType>
public NodeRecord getNodeRecord(DirectNodeHandle handle)
getNodeRecord
in interface NetworkSimulator<Identifier,MessageType>
public LivenessProvider<Identifier> getLivenessProvider()
getLivenessProvider
in interface NetworkSimulator<Identifier,MessageType>
public GenericNetworkSimulator<Identifier,MessageType> getGenericSimulator()
getGenericSimulator
in interface NetworkSimulator<Identifier,MessageType>
public void registerNode(Identifier i, DirectTransportLayer<Identifier,MessageType> dtl, NodeRecord nr)
registerNode
in interface NetworkSimulator<Identifier,MessageType>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |