bamboo.vivaldi
Class SpecialVC

java.lang.Object
  extended by bamboo.vivaldi.VirtualCoordinate
      extended by 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

Field Summary
 
Fields inherited from class bamboo.vivaldi.VirtualCoordinate
_coordinate, _delta
 
Constructor Summary
SpecialVC()
           
SpecialVC(ostore.util.InputBuffer buffer)
           
 
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 class bamboo.vivaldi.VirtualCoordinate
equals, getCoordinates, random_displacement, random_displacement, random_displacement, serialize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ostore.util.QuickSerializable
serialize
 

Constructor Detail

SpecialVC

public SpecialVC()

SpecialVC

public SpecialVC(ostore.util.InputBuffer buffer)
          throws ostore.util.QSException
Throws:
ostore.util.QSException
Method Detail

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.