org.placelab.client.tracker
Class CentroidTracker

java.lang.Object
  extended byorg.placelab.client.tracker.Tracker
      extended byorg.placelab.client.tracker.BeaconTracker
          extended byorg.placelab.client.tracker.CentroidTracker
All Implemented Interfaces:
SpotterListener

public class CentroidTracker
extends BeaconTracker

A simple tracker that computes the geometric center of the current set of readings. Right now, this is the best general purpose Tracker for WiFi because it produces the most accurate Measurements.


Field Summary
 
Fields inherited from class org.placelab.client.tracker.BeaconTracker
WIFI_MAX_DISTANCE
 
Constructor Summary
CentroidTracker(Mapper m)
           
 
Method Summary
 boolean acceptableMeasurement(Measurement m)
          Returns true if the tracker can make use of this reading to meaningfully update the estimate.
 Estimate getEstimate()
           
protected  void resetImpl()
          Subclasses should implement this to reset themselves to their initial state.
 void updateEstimateImpl(Measurement m)
          updateEstimateImpl uses the passed measurement to compute a simple geometic center.
 void updateWithoutMeasurement(long durationMillis)
          This method notifies a tracker that time has elapsed without a new mesurement.
 
Methods inherited from class org.placelab.client.tracker.BeaconTracker
findBeacon, findBeacon, getMapper, pickBeacon, pickBeacon
 
Methods inherited from class org.placelab.client.tracker.Tracker
addEstimateListener, fireEstimateUpdate, getLastUpdatedTime, gotMeasurement, numberOfMeasurements, removeEstimateListener, reset, spotterExceptionThrown, updateEstimate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentroidTracker

public CentroidTracker(Mapper m)
Method Detail

getEstimate

public Estimate getEstimate()
Specified by:
getEstimate in class Tracker
Returns:
The Tracker's latest Estimate

updateEstimateImpl

public void updateEstimateImpl(Measurement m)
updateEstimateImpl uses the passed measurement to compute a simple geometic center.

Specified by:
updateEstimateImpl in class Tracker
Parameters:
m - use this to update your Estimate

acceptableMeasurement

public boolean acceptableMeasurement(Measurement m)
Description copied from class: Tracker
Returns true if the tracker can make use of this reading to meaningfully update the estimate.

Overrides:
acceptableMeasurement in class BeaconTracker
Parameters:
m - returns true if this is a BeaconMeasurement

updateWithoutMeasurement

public void updateWithoutMeasurement(long durationMillis)
Description copied from class: Tracker
This method notifies a tracker that time has elapsed without a new mesurement. This gives the tracker a chance to update its estimate to account for predicted motion.

Specified by:
updateWithoutMeasurement in class Tracker

resetImpl

protected void resetImpl()
Description copied from class: Tracker
Subclasses should implement this to reset themselves to their initial state.

Specified by:
resetImpl in class Tracker