Class NonLinearFingerprintPositionEstimator<P extends com.irurueta.geometry.Point<?>>
java.lang.Object
com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionEstimator<P,FingerprintPositionEstimatorListener<P>>
com.irurueta.navigation.indoor.fingerprint.FingerprintPositionEstimator<P>
com.irurueta.navigation.indoor.fingerprint.NonLinearFingerprintPositionEstimator<P>
- Type Parameters:
P- aPointtype.
- Direct Known Subclasses:
NonLinearFingerprintPositionEstimator2D,NonLinearFingerprintPositionEstimator3D
public abstract class NonLinearFingerprintPositionEstimator<P extends com.irurueta.geometry.Point<?>>
extends FingerprintPositionEstimator<P>
Base class for position estimators based on located fingerprints containing only
RSSI readings and having as well prior knowledge of the location of radio sources
associated to those readings.
This implementation uses a Taylor approximation over provided located
fingerprints to determine an approximate position for a non-located fingerprint using
a non-linear solving algorithm.
An initial position can be provided as a starting point to solve the position,
otherwise the average point of selected nearest fingerprints is used as a starting
point.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanIndicates that by default covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.static final booleanIndicates that by default measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.static final booleanIndicates that by default path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.static final booleanIndicates that by default covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.static final NonLinearFingerprintPositionEstimatorTypeDefault type to be used when none is provided.static final doubleDefault RSSI standard deviation assumed for provided fingerprints as a fallback when none can be determined.private doubleEstimated chi square value.private com.irurueta.algebra.MatrixEstimated covariance matrix for estimated position.private doubleRSSI standard deviation fallback value to use when none can be determined from provided readings.private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiDimensionFitterLevenberg-Marquardt fitter to find a non-linear solution.private PInitial position to start the solving algorithm.private booleanIndicates whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.private booleanIndicates whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.private booleanIndicates whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.private booleanIndicates whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.static final doubleSmall value to be used as the minimum allowed RSSI standard deviations.Fields inherited from class com.irurueta.navigation.indoor.fingerprint.FingerprintPositionEstimator
removeMeansFromFingerprintReadings, sources, useNoMeanNearestFingerprintFinder, useSourcesPathLossExponentWhenAvailableFields inherited from class com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionEstimator
DEFAULT_MAX_NEAREST_FINGERPRINTS, DEFAULT_MIN_NEAREST_FINGERPRINTS, DEFAULT_PATH_LOSS_EXPONENT, estimatedPositionCoordinates, fingerprint, listener, locatedFingerprints, locked, maxNearestFingerprints, minNearestFingerprints, nearestFingerprints, pathLossExponent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedConstructor.protectedNonLinearFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> sources) Constructor.protectedNonLinearFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> sources, FingerprintPositionEstimatorListener<P> listener) Constructor.protectedNonLinearFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> sources, P initialPosition) Constructor.protectedNonLinearFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> sources, P initialPosition, FingerprintPositionEstimatorListener<P> listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbuildData(List<Double> allReceivedPower, List<Double> allFingerprintPower, List<P> allFingerprintPositions, List<P> allSourcesPositions, List<Double> allPathLossExponents, List<Double> allStandardDeviations) Builds data required to solve the problem.voidestimate()Estimates position based on provided located radio sources and readings of such radio sources at an unknown location.protected abstract doubleevaluate(int i, double[] point, double[] params, double[] derivatives) Evaluates a non-linear multi dimension function at provided point using provided parameters and returns its evaluation and derivatives of the function respect the function parameters.doublegetChiSq()Gets estimated chi square value.com.irurueta.algebra.MatrixGets estimated covariance matrix for estimated position.doubleGets RSSI standard deviation fallback value to use when none can be determined from provided readings.Gets initial position to start the solving algorithm.getType()Gets type of position estimator.booleanIndicates whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.booleanIndicates whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.booleanIndicates whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.booleanIndicates whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.protected abstract DoublepropagateVariances(double fingerprintRssi, double pathlossExponent, P fingerprintPosition, P radioSourcePosition, P estimatedPosition, Double fingerprintRssiVariance, Double pathlossExponentVariance, com.irurueta.algebra.Matrix fingerprintPositionCovariance, com.irurueta.algebra.Matrix radioSourcePositionCovariance) Propagates provided variances into RSSI variance of non-located fingerprint reading.voidsetFallbackRssiStandardDeviation(double fallbackRssiStandardDeviation) Sets RSSI standard deviation fallback value to use when none can be determined from provided readings.voidsetFingerprintPositionCovariancePropagated(boolean propagateFingerprintPositionCovariance) Specifies whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.voidsetFingerprintRssiStandardDeviationPropagated(boolean propagateFingerprintRssiStandardDeviation) Specifies whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.voidsetInitialPosition(P initialPosition) Sets initial position to start the solving algorithm.voidsetPathlossExponentStandardDeviationPropagated(boolean propagatePathlossExponentStandardDeviation) Specifies whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.voidsetRadioSourcePositionCovariancePropagated(boolean propagateRadioSourcePositionCovariance) Specifies whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.private voidSetups fitter to solve position.Methods inherited from class com.irurueta.navigation.indoor.fingerprint.FingerprintPositionEstimator
getSources, getUseNoMeanNearestFingerprintFinder, getUseSourcesPathLossExponentWhenAvailable, isMeansFromFingerprintReadingsRemoved, isReady, setMeansFromFingerprintReadingsRemoved, setSources, setUseNoMeanNearestFingerprintFinder, setUseSourcesPathLossExponentWhenAvailableMethods inherited from class com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionEstimator
getEstimatedPosition, getEstimatedPosition, getEstimatedPositionCoordinates, getFingerprint, getListener, getLocatedFingerprints, getMaxNearestFingerprints, getMinNearestFingerprints, getNearestFingerprints, getNumberOfDimensions, getPathLossExponent, isLocked, setFingerprint, setListener, setLocatedFingerprints, setMinMaxNearestFingerprints, setPathLossExponent, totalReadings
-
Field Details
-
FALLBACK_RSSI_STANDARD_DEVIATION
public static final double FALLBACK_RSSI_STANDARD_DEVIATIONDefault RSSI standard deviation assumed for provided fingerprints as a fallback when none can be determined.- See Also:
-
DEFAULT_PROPAGATE_FINGERPRINT_RSSI_STANDARD_DEVIATION
public static final boolean DEFAULT_PROPAGATE_FINGERPRINT_RSSI_STANDARD_DEVIATIONIndicates that by default measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.- See Also:
-
DEFAULT_PROPAGATE_PATHLOSS_EXPONENT_STANDARD_DEVIATION
public static final boolean DEFAULT_PROPAGATE_PATHLOSS_EXPONENT_STANDARD_DEVIATIONIndicates that by default path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.- See Also:
-
DEFAULT_PROPAGATE_FINGERPRINT_POSITION_COVARIANCE
public static final boolean DEFAULT_PROPAGATE_FINGERPRINT_POSITION_COVARIANCEIndicates that by default covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.- See Also:
-
DEFAULT_PROPAGATE_RADIO_SOURCE_POSITION_COVARIANCE
public static final boolean DEFAULT_PROPAGATE_RADIO_SOURCE_POSITION_COVARIANCEIndicates that by default covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.- See Also:
-
DEFAULT_TYPE
Default type to be used when none is provided. -
TINY_RSSI_STD
public static final double TINY_RSSI_STDSmall value to be used as the minimum allowed RSSI standard deviations. A value larger than this must be provided to allow convergence to a solution- See Also:
-
mInitialPosition
Initial position to start the solving algorithm. This should be a value close to the expected solution. If no value is provided, the average position among all selected nearest located fingerprints will be used. -
mFallbackRssiStandardDeviation
private double mFallbackRssiStandardDeviationRSSI standard deviation fallback value to use when none can be determined from provided readings. This fallback value is only used if no variance is propagated or the resulting value is too small to allow convergence to a solution. -
mPropagateFingerprintRssiStandardDeviation
private boolean mPropagateFingerprintRssiStandardDeviationIndicates whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location. -
mPropagatePathlossExponentStandardDeviation
private boolean mPropagatePathlossExponentStandardDeviationIndicates whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location. -
mPropagateFingerprintPositionCovariance
private boolean mPropagateFingerprintPositionCovarianceIndicates whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location. -
mPropagateRadioSourcePositionCovariance
private boolean mPropagateRadioSourcePositionCovarianceIndicates whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location. -
mFitter
private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiDimensionFitter mFitterLevenberg-Marquardt fitter to find a non-linear solution. -
mCovariance
private com.irurueta.algebra.Matrix mCovarianceEstimated covariance matrix for estimated position. -
mChiSq
private double mChiSqEstimated chi square value.
-
-
Constructor Details
-
NonLinearFingerprintPositionEstimator
protected NonLinearFingerprintPositionEstimator()Constructor.
-
-
Method Details
-
getInitialPosition
Gets initial position to start the solving algorithm. This should be a value close to the expected solution. If no value is provided, the average position among all selected nearest located fingerprints will be used.- Returns:
- initial position to start the solving algorithm or null.
-
setInitialPosition
Sets initial position to start the solving algorithm. This should be a value close to the expected solution. If no value is provided, the average position among all selected nearest located fingerprints will be used.- Parameters:
initialPosition- initial position to start the solving algorithm or null.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
getFallbackRssiStandardDeviation
public double getFallbackRssiStandardDeviation()Gets RSSI standard deviation fallback value to use when none can be determined from provided readings.- Returns:
- RSSI standard deviation fallback.
-
setFallbackRssiStandardDeviation
public void setFallbackRssiStandardDeviation(double fallbackRssiStandardDeviation) throws com.irurueta.navigation.LockedException Sets RSSI standard deviation fallback value to use when none can be determined from provided readings.- Parameters:
fallbackRssiStandardDeviation- RSSI standard deviation fallback- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.IllegalArgumentException- if provided value is smaller thanTINY_RSSI_STD.
-
isFingerprintRssiStandardDeviationPropagated
public boolean isFingerprintRssiStandardDeviationPropagated()Indicates whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.- Returns:
- true to propagate RSSI standard deviation of closest fingerprint, false otherwise.
-
setFingerprintRssiStandardDeviationPropagated
public void setFingerprintRssiStandardDeviationPropagated(boolean propagateFingerprintRssiStandardDeviation) throws com.irurueta.navigation.LockedException Specifies whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location.- Parameters:
propagateFingerprintRssiStandardDeviation- true to propagate RSSI standard deviation of closest fingerprint, false otherwise.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
isPathlossExponentStandardDeviationPropagated
public boolean isPathlossExponentStandardDeviationPropagated()Indicates whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.- Returns:
- true to propagate path-loss exponent standard deviation of radio source, false otherwise.
-
setPathlossExponentStandardDeviationPropagated
public void setPathlossExponentStandardDeviationPropagated(boolean propagatePathlossExponentStandardDeviation) throws com.irurueta.navigation.LockedException Specifies whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location.- Parameters:
propagatePathlossExponentStandardDeviation- true to propagate path-loss exponent standard deviation of radio source, false otherwise.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
isFingerprintPositionCovariancePropagated
public boolean isFingerprintPositionCovariancePropagated()Indicates whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.- Returns:
- true to propagate fingerprint position covariance, false otherwise.
-
setFingerprintPositionCovariancePropagated
public void setFingerprintPositionCovariancePropagated(boolean propagateFingerprintPositionCovariance) throws com.irurueta.navigation.LockedException Specifies whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location.- Parameters:
propagateFingerprintPositionCovariance- true to propagate fingerprint position covariance, false otherwise.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
isRadioSourcePositionCovariancePropagated
public boolean isRadioSourcePositionCovariancePropagated()Indicates whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.- Returns:
- true to propagate radio source position covariance, false otherwise.
-
setRadioSourcePositionCovariancePropagated
public void setRadioSourcePositionCovariancePropagated(boolean propagateRadioSourcePositionCovariance) throws com.irurueta.navigation.LockedException Specifies whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location.- Parameters:
propagateRadioSourcePositionCovariance- true to propagate radio source position covariance, false otherwise.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
getCovariance
public com.irurueta.algebra.Matrix getCovariance()Gets estimated covariance matrix for estimated position.- Returns:
- estimated covariance matrix for estimated position.
-
getChiSq
public double getChiSq()Gets estimated chi square value.- Returns:
- estimated chi square value.
-
estimate
public void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, FingerprintEstimationExceptionEstimates position based on provided located radio sources and readings of such radio sources at an unknown location.- Specified by:
estimatein classBaseFingerprintPositionEstimator<P extends com.irurueta.geometry.Point<?>,FingerprintPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>> - Throws:
com.irurueta.navigation.LockedException- if estimator is locked.com.irurueta.navigation.NotReadyException- if estimator is not ready.FingerprintEstimationException- if estimation fails for some other reason.
-
getType
Gets type of position estimator.- Returns:
- type of position estimator.
-
evaluate
protected abstract double evaluate(int i, double[] point, double[] params, double[] derivatives) Evaluates a non-linear multi dimension function at provided point using provided parameters and returns its evaluation and derivatives of the function respect the function parameters.- Parameters:
i- number of sample being evaluated.point- point where function will be evaluated.params- initial parameters estimation to be tried. These will change as the Levenberg-Marquardt algorithm iterates to the best solution. These are used as input parameters along with point to evaluate function.derivatives- partial derivatives of the function respect to each provided parameter.- Returns:
- function evaluation at provided point.
-
propagateVariances
protected abstract Double propagateVariances(double fingerprintRssi, double pathlossExponent, P fingerprintPosition, P radioSourcePosition, P estimatedPosition, Double fingerprintRssiVariance, Double pathlossExponentVariance, com.irurueta.algebra.Matrix fingerprintPositionCovariance, com.irurueta.algebra.Matrix radioSourcePositionCovariance) Propagates provided variances into RSSI variance of non-located fingerprint reading.- Parameters:
fingerprintRssi- closest located fingerprint reading RSSI expressed in dBm's.pathlossExponent- path-loss exponent.fingerprintPosition- position of closest located fingerprint.radioSourcePosition- radio source position associated to fingerprint reading.estimatedPosition- position to be estimated. Usually this is equal to the initial position used by a non-linear algorithm.fingerprintRssiVariance- variance of fingerprint RSSI or null if unknown.pathlossExponentVariance- variance of path-loss exponent or null if unknown.fingerprintPositionCovariance- covariance of fingerprint position or null if unknown.radioSourcePositionCovariance- covariance of radio source position or null if unknown.- Returns:
- variance of RSSI measured at non located fingerprint reading.
-
buildData
private void buildData(List<Double> allReceivedPower, List<Double> allFingerprintPower, List<P> allFingerprintPositions, List<P> allSourcesPositions, List<Double> allPathLossExponents, List<Double> allStandardDeviations) Builds data required to solve the problem.- Parameters:
allReceivedPower- list of received powers for readings at unknown positions.allFingerprintPower- list of power readings at fingerprint positions.allFingerprintPositions- list of fingerprint positions.allSourcesPositions- list of radio sources positions.allPathLossExponents- list of path loss exponents.allStandardDeviations- list of standard deviations for readings being used.
-
setupFitter
private void setupFitter() throws com.irurueta.numerical.fitting.FittingExceptionSetups fitter to solve position.- Throws:
com.irurueta.numerical.fitting.FittingException- if Levenberg-Marquardt fitting fails.
-