|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbamboo.vivaldi.VirtualCoordinate
public class VirtualCoordinate
Virtual network coordinates as calculated by Vivaldi. The update algorithm is included in this class.
| Field Summary | |
|---|---|
protected double[] |
_coordinate
|
protected double |
_delta
The dampening factor applied to each sample's update. |
| Constructor Summary | |
|---|---|
protected |
VirtualCoordinate()
Creates an virtual coordinate at the origin of the space. |
|
VirtualCoordinate(ostore.util.InputBuffer buffer)
|
| Method Summary | |
|---|---|
protected double[] |
displacement(VirtualCoordinate remote)
Returns a unit vector in the direction towards the remote coordinate. |
double |
distance(VirtualCoordinate destination)
Calculates the distance between this coordinate to the given destination. |
boolean |
equals(Object other)
|
double[] |
getCoordinates()
Returns a copy of the coordinate array. |
protected int |
getDimensions()
Returns the number of dimensions to use for this version of the virtual coordinates. |
protected double[] |
random_displacement()
|
protected double[] |
random_displacement(double[] dir,
int size)
Creates a unit vector in a random direction. |
protected double[] |
random_displacement(int size)
|
void |
serialize(ostore.util.OutputBuffer buffer)
|
String |
toString()
|
void |
update(VirtualCoordinate remote_coord,
double latency)
Update this coordinate's position with the given latency sample. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double _delta
protected double[] _coordinate
| Constructor Detail |
|---|
protected VirtualCoordinate()
dimensions - The number of dimensions to have
public VirtualCoordinate(ostore.util.InputBuffer buffer)
throws ostore.util.QSException
ostore.util.QSException| Method Detail |
|---|
protected int getDimensions()
public void serialize(ostore.util.OutputBuffer buffer)
serialize in interface ostore.util.QuickSerializablepublic double distance(VirtualCoordinate destination)
destination - The coordinate to compare this object against.
protected double[] displacement(VirtualCoordinate remote)
remote - The remote coordinate.
protected double[] random_displacement(double[] dir,
int size)
protected double[] random_displacement(int size)
protected double[] random_displacement()
public void update(VirtualCoordinate remote_coord,
double latency)
remote_coord - The node's coordinate used to get the latency sample.latency - The measured network latency (one-way, in milliseconds) to the remote node.public boolean equals(Object other)
equals in class Objectpublic String toString()
toString in class Objectpublic double[] getCoordinates()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||