public abstract class BasicLaterationAlgorithm extends Object implements LaterationAlgorithm
Offers evaluation method for localization accuracy and some statistical metrics to compare different algorithms.
Constructor and Description |
---|
BasicLaterationAlgorithm() |
Modifier and Type | Method and Description |
---|---|
void |
addRuntime(long runtime)
Adds the given runtime to the accumulated runtime.
|
void |
configure(Frame parent)
If this object is configurable, a dialog to configure the
object is shown.
|
double |
evaluate(Point2d[] anchors,
double[] ranges,
Point2d estimatedPosition,
Point2d actualPosition)
Evaluates the accuracy of the localization algorithm.
|
long |
getAverageRuntime()
Returns the average runtime of this algorithm.
|
double[] |
getHistogramData()
Returns the error histogram data.
|
int |
getLocalizationFailCount()
Returns the number of failed localizations, e.g. estimated position
was
null . |
double |
getMaximumError()
Returns the maximum error.
|
double |
getMeanAbsoluteError()
Returns the mean absolute error (MAE) also known as the
average positional error.
|
double[] |
getMeanAbsoluteErrorPerAnchor()
Gets the MAE per anchor where the index represents the amount of anchors.
|
double |
getMeanSquareError()
Returns the mean square error (MSE).
|
double |
getMeanSquareErrorMMSE()
Returns the mean square error (MSE) of the distance measurements
based on the estimated location.
|
double |
getRootMeanSquareError()
Returns the root mean square error (RMSE), a commonly used calculation
to measure the difference (or residual) between predicted and observed
values.
|
double |
getRootMeanSquareErrorMMSE()
Returns the root mean square error (RMSE) of the distance measurements
based on the estimated location.
|
double |
getStandardDeviation()
Returns the standard deviation (SDEV).
|
boolean |
isConfigurable()
Tests, if this object is configurable.
|
void |
reset()
Resets all statistical metrics, counters and collected data.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, localize
public double evaluate(Point2d[] anchors, double[] ranges, Point2d estimatedPosition, Point2d actualPosition)
Also updates different accuracy metrics like mean absolute error (MAE), maximum error, root mean square error (RMSE) and the localization fail count.
anchors
- The anchor/reference node locations.ranges
- The measured distances to the anchor/reference nodes.estimatedPosition
- The estimated position of the mobile node or
null
if position unknown (e.g.
calculation failed).actualPosition
- The actual position of the mobile node or
null
if position unknown.-1
on error.public int getLocalizationFailCount()
null
.public double getMeanAbsoluteError()
public double getMaximumError()
public double getStandardDeviation()
public double getMeanSquareError()
public double getRootMeanSquareError()
public double getMeanSquareErrorMMSE()
public double getRootMeanSquareErrorMMSE()
public double[] getHistogramData()
public double[] getMeanAbsoluteErrorPerAnchor()
public long getAverageRuntime()
public void addRuntime(long runtime)
runtime
- The runtime of the last run in nanoseconds.public void reset()
public boolean isConfigurable()
Configurable
isConfigurable
in interface Configurable
true
if this object is configurable;
false
otherwise.public void configure(Frame parent)
Configurable
configure
in interface Configurable
parent
- The parent frame of the new dialog.Copyright © 2012 Thomas Hillebrandt. All Rights Reserved.