|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.pastry.direct.SphereNetwork
Sphere network topology and idealized node life. Emulates a network of nodes that are randomly placed on a sphere. Proximity is based on euclidean distance on the sphere.
Constructor Summary | |
SphereNetwork()
Constructor. |
Method Summary | |
void |
deliverMessage(Message msg,
PastryNode node)
DESCRIBE THE METHOD |
DirectNodeHandle |
getClosest(NodeId nid)
find the closest NodeId to an input NodeId out of all NodeIds in the network |
TestRecord |
getTestRecord()
get TestRecord |
boolean |
isAlive(NodeId nid)
testing if a NodeId is alive |
int |
proximity(NodeId a,
NodeId b)
computes the proximity between two NodeIds |
void |
registerNodeId(DirectNodeHandle nh)
register a new node |
void |
setAlive(NodeId nid,
boolean alive)
set the liveliness of a NodeId |
void |
setTestRecord(TestRecord tr)
set TestRecord |
boolean |
simulate()
DESCRIBE THE METHOD |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SphereNetwork()
Method Detail |
public boolean isAlive(NodeId nid)
isAlive
in interface NetworkSimulator
nid
- the NodeId being tested
public TestRecord getTestRecord()
getTestRecord
in interface NetworkSimulator
public DirectNodeHandle getClosest(NodeId nid)
getClosest
in interface NetworkSimulator
nid
- the input NodeId
public void setAlive(NodeId nid, boolean alive)
setAlive
in interface NetworkSimulator
nid
- the NodeId being setalive
- the value being setpublic void setTestRecord(TestRecord tr)
setTestRecord
in interface NetworkSimulator
tr
- input TestRecordpublic void registerNodeId(DirectNodeHandle nh)
registerNodeId
in interface NetworkSimulator
nh
- the DirectNodeHandle being registeredpublic int proximity(NodeId a, NodeId b)
proximity
in interface NetworkSimulator
a
- the first NodeIdb
- the second NodeId
public void deliverMessage(Message msg, PastryNode node)
deliverMessage
in interface NetworkSimulator
msg
- DESCRIBE THE PARAMETERnode
- DESCRIBE THE PARAMETERpublic boolean simulate()
simulate
in interface NetworkSimulator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |