|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.client.tracker.Tracker
org.placelab.example.CentroidTrackerExample
This sample is a tracker that calculates the centroid of the observed readings. This tracker estimates the device position to be the geometric center of the readings that have the same timestamp.
| Constructor Summary | |
CentroidTrackerExample(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()
return an estimate based on the last set of measurements we saw * |
static void |
main(java.lang.String[] args)
|
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.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 |
public CentroidTrackerExample(Mapper m)
| Method Detail |
public Estimate getEstimate()
getEstimate in class Trackerpublic void updateEstimateImpl(Measurement m)
updateEstimateImpl in class Trackerm - use this to update your Estimatepublic boolean acceptableMeasurement(Measurement m)
Tracker
acceptableMeasurement in class Trackerpublic void updateWithoutMeasurement(long durationMillis)
Tracker
updateWithoutMeasurement in class Trackerprotected void resetImpl()
Tracker
resetImpl in class Trackerpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||