Class NonLinearFingerprintPositionAndRadioSourceEstimator<P extends com.irurueta.geometry.Point<?>>
java.lang.Object
com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionAndRadioSourceEstimator<P,FingerprintPositionAndRadioSourceEstimatorListener<P>>
com.irurueta.navigation.indoor.fingerprint.FingerprintPositionAndRadioSourceEstimator<P>
com.irurueta.navigation.indoor.fingerprint.NonLinearFingerprintPositionAndRadioSourceEstimator<P>
- Direct Known Subclasses:
NonLinearFingerprintPositionAndRadioSourceEstimator2D,NonLinearFingerprintPositionAndRadioSourceEstimator3D
public abstract class NonLinearFingerprintPositionAndRadioSourceEstimator<P extends com.irurueta.geometry.Point<?>>
extends FingerprintPositionAndRadioSourceEstimator<P>
Base class for position and radio source estimators based only on located
fingerprints containing RSSI readings.
All implementations of this class estimate the position of a new fingerprint
and the position of all radio sources associated to fingerprints whose location
is known.
All implementations solve the problem in a non-linear way using Levenberg-Marquardt
algorithm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleEstimated chi square value.private com.irurueta.algebra.MatrixEstimated covariance matrix for estimated non-located fingerprint position and estimated located radio sources position.static 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.private com.irurueta.algebra.MatrixCovariance of estimated position for non-located fingerprint.static final doubleDefault RSSI standard deviation assumed for provided fingerprints as a fallback when none can be determined.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 estimation.protected List<? extends RadioSourceLocated<P>> Initial sources whose location is known.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.private static final doubleSmall value to be used as machine precision.protected booleanIndicates whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead.Fields inherited from class com.irurueta.navigation.indoor.fingerprint.FingerprintPositionAndRadioSourceEstimator
useNoMeanNearestFingerprintFinderFields inherited from class com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionAndRadioSourceEstimator
DEFAULT_MAX_NEAREST_FINGERPRINTS, DEFAULT_MIN_NEAREST_FINGERPRINTS, DEFAULT_PATH_LOSS_EXPONENT, estimatedLocatedSources, estimatedPositionCoordinates, fingerprint, listener, locatedFingerprints, locked, maxNearestFingerprints, minNearestFingerprints, nearestFingerprints, pathLossExponent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(FingerprintPositionAndRadioSourceEstimatorListener<P> listener) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, FingerprintPositionAndRadioSourceEstimatorListener<P> listener) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> initialLocatedSources) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, List<? extends RadioSourceLocated<P>> initialLocatedSources, FingerprintPositionAndRadioSourceEstimatorListener<P> listener) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, P initialPosition) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, P initialPosition, FingerprintPositionAndRadioSourceEstimatorListener<P> listener) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, P initialPosition, List<? extends RadioSourceLocated<P>> initialLocatedSources) Constructor.protectedNonLinearFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, P initialPosition, List<? extends RadioSourceLocated<P>> initialLocatedSources, FingerprintPositionAndRadioSourceEstimatorListener<P> listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbuildData(List<Double> allPowerDiffs, List<P> allFingerprintPositions, List<P> allInitialSourcesPositions, List<RadioSource> allSourcesToBeEstimated, List<Integer> allSourcesIndices, List<Double> allPathLossExponents, List<Double> allStandardDeviations, P nearestFingerprintsCentroid) Builds data required to solve the problem.private RadioSourceLocated<P> createRadioSource(RadioSource source, P sourcePosition, com.irurueta.algebra.Matrix sourceCovariance) Creates a located radio source from provided radio source, position and covariance.voidestimate()Estimates position and radio sources based on provided located radio sources and readings of such radio sources at an unknown location.doublegetChiSq()Gets estimated chi square value.com.irurueta.algebra.MatrixGets estimated covariance matrix for estimated non-located fingerprint position and estimated located radio sources position.com.irurueta.algebra.MatrixGets covariance of estimated position for non-located fingerprint.doubleGets RSSI standard deviation fallback value to use when none can be determined from provided readings.Gets initial radio sources whose location is known.Gets initial position to start the solving algorithm.booleanIndicates whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead.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 pathlossExponent, P fingerprintPosition, P radioSourcePosition, P estimatedPosition, Double pathlossExponentVariance, com.irurueta.algebra.Matrix fingerprintPositionCovariance, com.irurueta.algebra.Matrix radioSourcePositionCovariance) Propagates provided variances into RSSI differences.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.voidsetInitialLocatedSources(List<? extends RadioSourceLocated<P>> initialLocatedSources) Sets initial radio sources whose location is known.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 List<RadioSource> Setups fitter to solve positions.voidsetUseSourcesPathLossExponentWhenAvailable(boolean useSourcesPathLossExponentWhenAvailable) Specifies whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead.private inttotalReadingsForSource(RadioSource source, List<RssiFingerprintLocated<RadioSource, RssiReading<RadioSource>, P>> fingerprints, P centroid) Gets the total number of readings associated to provided radio source.Methods inherited from class com.irurueta.navigation.indoor.fingerprint.FingerprintPositionAndRadioSourceEstimator
getUseNoMeanNearestFingerprintFinder, setUseNoMeanNearestFingerprintFinderMethods inherited from class com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionAndRadioSourceEstimator
createPoint, getEstimatedLocatedSources, getEstimatedPosition, getEstimatedPosition, getEstimatedPositionCoordinates, getFingerprint, getListener, getLocatedFingerprints, getMaxNearestFingerprints, getMinNearestFingerprints, getNearestFingerprints, getNumberOfDimensions, getPathLossExponent, isLocked, isReady, setFingerprint, setListener, setLocatedFingerprints, setMinMaxNearestFingerprints, setPathLossExponent
-
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:
-
TINY
private static final double TINYSmall value to be used as machine precision.- See Also:
-
mInitialLocatedSources
protected List<? extends RadioSourceLocated<P extends com.irurueta.geometry.Point<?>>> mInitialLocatedSourcesInitial sources whose location is known. If provided, their location will be used as initial values, but after executing this estimator they will be refined. -
initialPosition
Initial position to start the estimation. 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. -
useSourcesPathLossExponentWhenAvailable
protected boolean useSourcesPathLossExponentWhenAvailableIndicates whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead. -
fallbackRssiStandardDeviation
private double fallbackRssiStandardDeviationRSSI 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. -
propagateFingerprintRssiStandardDeviation
private boolean propagateFingerprintRssiStandardDeviationIndicates whether measured RSSI standard deviation of closest fingerprint must be propagated into measured RSSI reading variance at unknown location. -
propagatePathlossExponentStandardDeviation
private boolean propagatePathlossExponentStandardDeviationIndicates whether path-loss exponent standard deviation of radio source must be propagated into measured RSSI reading variance at unknown location. -
propagateFingerprintPositionCovariance
private boolean propagateFingerprintPositionCovarianceIndicates whether covariance of closest fingerprint position must be propagated into measured RSSI reading variance at unknown location. -
propagateRadioSourcePositionCovariance
private boolean propagateRadioSourcePositionCovarianceIndicates whether covariance of radio source position must be propagated into measured RSSI reading variance at unknown location. -
fitter
private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiDimensionFitter fitterLevenberg-Marquardt fitter to find a non-linear solution. -
covariance
private com.irurueta.algebra.Matrix covarianceEstimated covariance matrix for estimated non-located fingerprint position and estimated located radio sources position. -
estimatedPositionCovariance
private com.irurueta.algebra.Matrix estimatedPositionCovarianceCovariance of estimated position for non-located fingerprint. -
chiSq
private double chiSqEstimated chi square value.
-
-
Constructor Details
-
NonLinearFingerprintPositionAndRadioSourceEstimator
protected NonLinearFingerprintPositionAndRadioSourceEstimator()Constructor.
-
-
Method Details
-
getInitialLocatedSources
Gets initial radio sources whose location is known.- Returns:
- initial radio sources.
-
setInitialLocatedSources
public void setInitialLocatedSources(List<? extends RadioSourceLocated<P>> initialLocatedSources) throws com.irurueta.navigation.LockedException Sets initial radio sources whose location is known.- Parameters:
initialLocatedSources- initial radio sources.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
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.
-
getCovariance
public com.irurueta.algebra.Matrix getCovariance()Gets estimated covariance matrix for estimated non-located fingerprint position and estimated located radio sources position.- Returns:
- estimated covariance matrix for estimated non-located fingerprint position and estimated located radio sources position.
-
getEstimatedPositionCovariance
public com.irurueta.algebra.Matrix getEstimatedPositionCovariance()Gets covariance of estimated position for non-located fingerprint.- Returns:
- covariance of estimated position for non-located fingerprint.
-
getChiSq
public double getChiSq()Gets estimated chi square value.- Returns:
- estimated chi square value.
-
getUseSourcesPathLossExponentWhenAvailable
public boolean getUseSourcesPathLossExponentWhenAvailable()Indicates whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead.- Returns:
- true to use path loss exponent of provided sources when available, false otherwise.
-
setUseSourcesPathLossExponentWhenAvailable
public void setUseSourcesPathLossExponentWhenAvailable(boolean useSourcesPathLossExponentWhenAvailable) throws com.irurueta.navigation.LockedException Specifies whether path loss exponent of provided sources must be used when available (if true), or if fallback path loss exponent must be used instead.- Parameters:
useSourcesPathLossExponentWhenAvailable- true to use path loss exponent of provided sources when available, false otherwise.- 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.
-
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.
-
estimate
public void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, FingerprintEstimationExceptionEstimates position and radio sources based on provided located radio sources and readings of such radio sources at an unknown location.- Specified by:
estimatein classBaseFingerprintPositionAndRadioSourceEstimator<P extends com.irurueta.geometry.Point<?>,FingerprintPositionAndRadioSourceEstimatorListener<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.
-
propagateVariances
protected abstract Double propagateVariances(double pathlossExponent, P fingerprintPosition, P radioSourcePosition, P estimatedPosition, Double pathlossExponentVariance, com.irurueta.algebra.Matrix fingerprintPositionCovariance, com.irurueta.algebra.Matrix radioSourcePositionCovariance) Propagates provided variances into RSSI differences.- Parameters:
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.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 difference measured at non located fingerprint reading.
-
buildData
private void buildData(List<Double> allPowerDiffs, List<P> allFingerprintPositions, List<P> allInitialSourcesPositions, List<RadioSource> allSourcesToBeEstimated, List<Integer> allSourcesIndices, List<Double> allPathLossExponents, List<Double> allStandardDeviations, P nearestFingerprintsCentroid) Builds data required to solve the problem. This method takes into account current nearest fingerprints and discards those readings belonging to radio sources not having enough data to be estimated.- Parameters:
allPowerDiffs- list of received power differences of RSSI readings between a located fingerprint and an unknown fingerprint for a given radio source.allFingerprintPositions- positions of all located fingerprints being taken into account.allInitialSourcesPositions- initial positions of all radio sources to be taken into account. If initial located sources where provided, their positions will be used, otherwise the centroid of all located fingerprints associated to a radio source will be used as initial position.allSourcesToBeEstimated- all radio sources that will be estimated.allSourcesIndices- indices indicating the position radio source being used within the list of sources for current reading.allPathLossExponents- list of path loss exponents.allStandardDeviations- list of standard deviations for readings being used.nearestFingerprintsCentroid- centroid of nearest fingerprints being taken into account.
-
setupFitter
Setups fitter to solve positions.- Returns:
- list of radio sources whose location will be estimated.
- Throws:
com.irurueta.numerical.fitting.FittingException- if Levenberg-Marquardt fitting fails.
-