public class OptimalAnchorSelectionAlgorithm extends BasicLaterationAlgorithm
Selects anchors which lead to best localization result. Only works if real location of mobile node is known.
This algorithm is for optimization purposes only and not contained in the algorithm collection class!
Modifier and Type | Class and Description |
---|---|
static class |
OptimalAnchorSelectionAlgorithm.InternalBfOasaStatistic
Internal statistic for evaluation of BF-OASA.
|
Constructor and Description |
---|
OptimalAnchorSelectionAlgorithm() |
OptimalAnchorSelectionAlgorithm(BasicLaterationAlgorithm algorithm) |
Modifier and Type | Method and Description |
---|---|
BasicLaterationAlgorithm |
getAlgorithm() |
String |
getName()
Returns the name of the algorithm.
|
OptimalAnchorSelectionAlgorithm.InternalBfOasaStatistic |
getStatistic() |
Point2d |
localize(Point2d[] anchors,
double[] ranges,
Point2d actualPosition,
ErrorModel errorModel,
int width,
int height)
Runs the localization algorithm and returns the estimated position.
|
static Point2d |
multilaterate(Point2d[] anchors,
double[] ranges,
Point2d actualPosition,
ErrorModel errorModel,
BasicLaterationAlgorithm algorithm,
OptimalAnchorSelectionAlgorithm.InternalBfOasaStatistic statistics)
Static call to this lateration algorithm.
|
void |
reset()
Also reset internal algorithm used (for statistics).
|
void |
setAlgorithm(BasicLaterationAlgorithm algorithm) |
String |
toString()
Returns a string representation of this lateration algorithm.
|
addRuntime, configure, evaluate, getAverageRuntime, getHistogramData, getLocalizationFailCount, getMaximumError, getMeanAbsoluteError, getMeanAbsoluteErrorPerAnchor, getMeanSquareError, getMeanSquareErrorMMSE, getRootMeanSquareError, getRootMeanSquareErrorMMSE, getStandardDeviation, isConfigurable
public OptimalAnchorSelectionAlgorithm()
public OptimalAnchorSelectionAlgorithm(BasicLaterationAlgorithm algorithm)
public BasicLaterationAlgorithm getAlgorithm()
public void setAlgorithm(BasicLaterationAlgorithm algorithm)
public OptimalAnchorSelectionAlgorithm.InternalBfOasaStatistic getStatistic()
public String getName()
LaterationAlgorithm
The name should not be too long, e.g. less than 20 chars.
public Point2d localize(Point2d[] anchors, double[] ranges, Point2d actualPosition, ErrorModel errorModel, int width, int height)
LaterationAlgorithm
The size of the anchor and measured ranges array must be at least 3.
The actual position of the mobile node is passed to this method to allow the development of some sort of "cheating algorithm" which does some sort of optimum selection along a set of different algorithms.
The error model can be used by algorithms to determine the current average and maximum distance measurement error.
anchors
- The anchor/reference nodes.ranges
- The measured distances to the anchor/reference nodes.actualPosition
- The actual location of the mobile node to be located.errorModel
- The current error model used for simulation or
null
if running with real data (no error
model available).width
- The width of the playing field used for simulation or
-1
if running with real data.height
- The height of the playing field used for simulation or
-1
if running with real data.null
if no position could be calculated, e.g.
localization failed.public String toString()
public void reset()
reset
in class BasicLaterationAlgorithm
public static Point2d multilaterate(Point2d[] anchors, double[] ranges, Point2d actualPosition, ErrorModel errorModel, BasicLaterationAlgorithm algorithm, OptimalAnchorSelectionAlgorithm.InternalBfOasaStatistic statistics)
This might be useful if one is only interested in the result and not
the additional features of the BasicLaterationAlgorithm
class.
anchors
- The anchor/reference nodes.ranges
- The measured distances to the anchor/reference nodes.actualPosition
- The actual location of the mobile node to be located.errorModel
- The current error model used for simulation or
null
if running with real data (no error
model available).algorithm
- The algorithm that really does the localization.statistics
- Object to store statistics about BF-OASA.null
if no position could be calculated, e.g.
localization failed.Copyright © 2012 Thomas Hillebrandt. All Rights Reserved.