bamboo.vivaldi
Class SpecialVC
java.lang.Object
bamboo.vivaldi.VirtualCoordinate
bamboo.vivaldi.SpecialVC
- All Implemented Interfaces:
- ostore.util.QuickSerializable
public class SpecialVC
- extends VirtualCoordinate
- implements ostore.util.QuickSerializable
A virtual coordinate class where coordinates are modeled by a position
on a plane, and a height away from it.
- Version:
- $Id: SpecialVC.java,v 1.3 2004/03/10 20:39:43 czerwin Exp $
- Author:
- Steven E. Czerwinski
|
Method Summary |
double[] |
displacement(VirtualCoordinate destination)
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. |
protected int |
getDimensions()
Returns the number of dimensions to use for this version of the
virtual coordinates. |
void |
update(VirtualCoordinate remote_coord,
double latency)
Update this coordinate's position with the given latency sample. |
| Methods inherited from interface ostore.util.QuickSerializable |
serialize |
SpecialVC
public SpecialVC()
SpecialVC
public SpecialVC(ostore.util.InputBuffer buffer)
throws ostore.util.QSException
- Throws:
ostore.util.QSException
getDimensions
protected int getDimensions()
- Description copied from class:
VirtualCoordinate
- Returns the number of dimensions to use for this version of the
virtual coordinates.
- Overrides:
getDimensions in class VirtualCoordinate
distance
public double distance(VirtualCoordinate destination)
- Calculates the distance between this coordinate to the given
destination. This will be an estimate of the one-way network
latencies between the two nodes in milliseconds.
- Overrides:
distance in class VirtualCoordinate
- Parameters:
destination - The coordinate to compare this object against.
- Returns:
- The distance between the coordinates, as expressed by one-way network latency in milliseconds.
displacement
public double[] displacement(VirtualCoordinate destination)
- Description copied from class:
VirtualCoordinate
- Returns a unit vector in the direction towards the remote coordinate.
If the coordinates are the same, null is returned since you cannot
produce a unit vector.
- Overrides:
displacement in class VirtualCoordinate
- Parameters:
destination - The remote coordinate.
- Returns:
- A unit vector in the direction towards the remote, or null if the coords are the same.
update
public void update(VirtualCoordinate remote_coord,
double latency)
- Update this coordinate's position with the given latency sample.
- Overrides:
update in class VirtualCoordinate
- Parameters:
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.