Class BaseFingerprintPositionEstimator<P extends com.irurueta.geometry.Point<?>,L extends BaseFingerprintEstimatorListener<?>>
java.lang.Object
com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionEstimator<P,L>
- Type Parameters:
P- aPointtype.L- aBaseFingerprintEstimatorListenertype.
- Direct Known Subclasses:
FingerprintPositionEstimator
public abstract class BaseFingerprintPositionEstimator<P extends com.irurueta.geometry.Point<?>,L extends BaseFingerprintEstimatorListener<?>>
extends Object
Base class for position estimators based on located fingerprints containing only
RSSI readings without any prior knowledge of radio sources.
These kind of estimators can be used to determine the position of a given device by
getting RSSI readings at an unknown location of different radio sources and comparing
those readings with other located ones.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum number of nearest fingerprints to search (no limit).static final intDefault minimum number of nearest fingerprints to search.static final doubleDefault exponent typically used on free space for path loss propagation in terms of distance.protected double[]Estimated inhomogeneous position coordinates.protected RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> Fingerprint containing readings at an unknown location.protected LListener to be notified of events raised by this instance.protected List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> Located fingerprints containing RSSI readings.protected booleanIndicates if this instance is locked.protected intMaximum number of nearest fingerprints to search or -1 if there is no limit and all provided fingerprints are used.protected intMinimum number of nearest fingerprints to search.protected List<RssiFingerprintLocated<RadioSource, RssiReading<RadioSource>, P>> Nearest located fingerprints based on their RSSI readings respect to provided fingerprint.protected doublePath loss exponent to be used by default. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedBaseFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint) Constructor.protectedBaseFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, L listener) Constructor.protectedBaseFingerprintPositionEstimator(L listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidestimate()Starts estimation based on provided located radio sources and readings of such radio sources at an unknown location.abstract PGets estimated position.voidgetEstimatedPosition(P estimatedPosition) Gets estimated position and stores result into provided instance.double[]Gets estimated inhomogeneous position coordinates.Gets fingerprint containing readings at an unknown location for provided located fingerprints.Gets listener to be notified of events raised by this instance.Gets located fingerprints containing RSSI readings.intGets maximum number of nearest fingerprints to search.intGet minimum number of nearest fingerprints to search.Gets nearest found located fingerprints based on their RSSI readings respect to provided fingerprint.abstract intGets number of dimensions of points.doubleGets path loss exponent to be used by default.private voidinternalSetFingerprint(RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint) Internally sets fingerprint containing readings at an unknown location for provided located fingerprints.private voidinternalSetLocatedFingerprints(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints) Internally sets located fingerprints containing RSSI readings.private voidinternalSetMinMaxNearestFingerprints(int minNearestFingerprints, int maxNearestFingerprints) Sets minimum and maximum number of nearest fingerprints to search.booleanisLocked()Returns boolean indicating whether this estimator is locked because an estimation is already in progress.abstract booleanisReady()Indicates whether estimator is ready to find a solution.voidsetFingerprint(RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint) Sets fingerprint containing readings at an unknown location for provided located fingerprints.voidsetListener(L listener) Sets listener to be notified of events raised by this instance.voidsetLocatedFingerprints(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints) Sets located fingerprints containing RSSI readings.voidsetMinMaxNearestFingerprints(int minNearestFingerprints, int maxNearestFingerprints) Sets minimum and maximum number of nearest fingerprints to search.voidsetPathLossExponent(double pathLossExponent) Sets path loss exponent to be used by default.(package private) inttotalReadings(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints) Gets total number of readings contained within provided fingerprints.
-
Field Details
-
DEFAULT_MIN_NEAREST_FINGERPRINTS
public static final int DEFAULT_MIN_NEAREST_FINGERPRINTSDefault minimum number of nearest fingerprints to search.- See Also:
-
DEFAULT_MAX_NEAREST_FINGERPRINTS
public static final int DEFAULT_MAX_NEAREST_FINGERPRINTSDefault maximum number of nearest fingerprints to search (no limit).- See Also:
-
DEFAULT_PATH_LOSS_EXPONENT
public static final double DEFAULT_PATH_LOSS_EXPONENTDefault exponent typically used on free space for path loss propagation in terms of distance. This value is used for free space environments.- See Also:
-
locatedFingerprints
protected List<? extends RssiFingerprintLocated<? extends RadioSource,? extends RssiReading<? extends RadioSource>, locatedFingerprintsP extends com.irurueta.geometry.Point<?>>> Located fingerprints containing RSSI readings. -
fingerprint
protected RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprintFingerprint containing readings at an unknown location. Readings need to belong to the same radio sources as those given at located fingerprints -
minNearestFingerprints
protected int minNearestFingerprintsMinimum number of nearest fingerprints to search. -
maxNearestFingerprints
protected int maxNearestFingerprintsMaximum number of nearest fingerprints to search or -1 if there is no limit and all provided fingerprints are used. -
pathLossExponent
protected double pathLossExponentPath loss exponent to be used by default. This is typically used on free space for path loss propagation in terms of distance. On different environments path loss exponent might have different values: - Free space: 2.0 - Urban Area: 2.7 to 3.5 - Suburban Area: 3 to 5 - Indoor (line-of-sight): 1.6 to 1.8 -
listener
Listener to be notified of events raised by this instance. -
estimatedPositionCoordinates
protected double[] estimatedPositionCoordinatesEstimated inhomogeneous position coordinates. -
nearestFingerprints
protected List<RssiFingerprintLocated<RadioSource,RssiReading<RadioSource>, nearestFingerprintsP extends com.irurueta.geometry.Point<?>>> Nearest located fingerprints based on their RSSI readings respect to provided fingerprint. These are the fingerprints that are probably located close to the unknown location to be estimated, however their location is approximate due to errors on RSSI readings. -
locked
protected boolean lockedIndicates if this instance is locked.
-
-
Constructor Details
-
BaseFingerprintPositionEstimator
protected BaseFingerprintPositionEstimator()Constructor. -
BaseFingerprintPositionEstimator
Constructor.- Parameters:
listener- listener in charge of handling events.
-
-
Method Details
-
getLocatedFingerprints
public List<RssiFingerprintLocated<RadioSource,RssiReading<RadioSource>, getLocatedFingerprints()P>> Gets located fingerprints containing RSSI readings.- Returns:
- located fingerprints containing RSSI readings.
-
setLocatedFingerprints
public void setLocatedFingerprints(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, throws com.irurueta.navigation.LockedExceptionP>> locatedFingerprints) Sets located fingerprints containing RSSI readings.- Parameters:
locatedFingerprints- located fingerprints containing RSSI readings.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.IllegalArgumentException- if provided value is null or there are not enough fingerprints or readings within provided fingerprints (for 2D position estimation at least 2 readings are required in a single fingerprint, or at least 2 fingerprints at different locations containing a single reading are required. For 3D position estimation 3 reading in a single fingerprint, or 3 fingerprints containing a single reading or any combination resulting in at least 3 readings at different locations are required).
-
getFingerprint
Gets fingerprint containing readings at an unknown location for provided located fingerprints.- Returns:
- fingerprint containing readings at an unknown location for provided located fingerprints.
-
getMinNearestFingerprints
public int getMinNearestFingerprints()Get minimum number of nearest fingerprints to search.- Returns:
- minimum number of nearest fingerprints.
-
getMaxNearestFingerprints
public int getMaxNearestFingerprints()Gets maximum number of nearest fingerprints to search.- Returns:
- maximum number of nearest fingerprints.
-
setMinMaxNearestFingerprints
public void setMinMaxNearestFingerprints(int minNearestFingerprints, int maxNearestFingerprints) throws com.irurueta.navigation.LockedException Sets minimum and maximum number of nearest fingerprints to search.- Parameters:
minNearestFingerprints- minimum number of nearest fingerprints.maxNearestFingerprints- maximum number of nearest fingerprints.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.IllegalArgumentException- if minimum value is larger than maximum value (as long as it has a limit defined), or if minimum value is less than 1.
-
getPathLossExponent
public double getPathLossExponent()Gets path loss exponent to be used by default. This is typically used on free space for path loss propagation in terms of distance. On different environments path loss exponent might have different values: - Free space: 2.0 - Urban Area: 2.7 to 3.5 - Suburban Area: 3 to 5 - Indoor (line-of-sight): 1.6 to 1.8- Returns:
- path loss exponent to be used by default.
-
setPathLossExponent
public void setPathLossExponent(double pathLossExponent) throws com.irurueta.navigation.LockedException Sets path loss exponent to be used by default. This is typically used on free space for path loss propagation in terms of distance. On different environments path loss exponent might have different values: - Free space: 2.0 - Urban Area: 2.7 to 3.5 - Suburban Area: 3 to 5 - Indoor (line-of-sight): 1.6 to 1.8- Parameters:
pathLossExponent- path loss exponent to be used by default.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
getListener
Gets listener to be notified of events raised by this instance.- Returns:
- listener to be notified of events raised by this instance.
-
setListener
Sets listener to be notified of events raised by this instance.- Parameters:
listener- listener to be notified of events raised by this instance.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
getEstimatedPositionCoordinates
public double[] getEstimatedPositionCoordinates()Gets estimated inhomogeneous position coordinates.- Returns:
- estimated inhomogeneous position coordinates.
-
getEstimatedPosition
Gets estimated position and stores result into provided instance.- Parameters:
estimatedPosition- instance where estimated position will be stored.
-
getNearestFingerprints
public List<RssiFingerprintLocated<RadioSource,RssiReading<RadioSource>, getNearestFingerprints()P>> Gets nearest found located fingerprints based on their RSSI readings respect to provided fingerprint. These are the fingerprints that are probably located close to the unknown location to be estimated, however their location is approximate due to errors on RSSI readings.- Returns:
- nearest located fingerprints based on their RSSI readings or null if estimation has not been done yet.
-
isLocked
public boolean isLocked()Returns boolean indicating whether this estimator is locked because an estimation is already in progress.- Returns:
- true if estimator is locked, false otherwise.
-
getNumberOfDimensions
public abstract int getNumberOfDimensions()Gets number of dimensions of points.- Returns:
- number of dimensions of points.
-
isReady
public abstract boolean isReady()Indicates whether estimator is ready to find a solution.- Returns:
- true if estimator is ready, false otherwise.
-
estimate
public abstract void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, FingerprintEstimationExceptionStarts estimation based on provided located radio sources and readings of such radio sources at an unknown location.- 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.
-
getEstimatedPosition
Gets estimated position.- Returns:
- estimated position.
-
totalReadings
int totalReadings(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints) Gets total number of readings contained within provided fingerprints.- Parameters:
locatedFingerprints- fingerprints to be checked.- Returns:
- total number of readings contained within provided fingerprints.
-
internalSetLocatedFingerprints
private void internalSetLocatedFingerprints(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints) Internally sets located fingerprints containing RSSI readings.- Parameters:
locatedFingerprints- located fingerprints containing RSSI readings.- Throws:
IllegalArgumentException- if provided value is null or there are not enough fingerprints or readings within provided fingerprints (for 2D position estimation at least 2 located total readings are required among all fingerprints, for example 2 readings are required in a single fingerprint, or at least 2 fingerprints at different locations containing a single reading are required. For 3D position estimation 3 located total readings are required among all fingerprints).
-
internalSetMinMaxNearestFingerprints
private void internalSetMinMaxNearestFingerprints(int minNearestFingerprints, int maxNearestFingerprints) Sets minimum and maximum number of nearest fingerprints to search.- Parameters:
minNearestFingerprints- minimum number of nearest fingerprints.maxNearestFingerprints- maximum number of nearest fingerprints.- Throws:
IllegalArgumentException- if minimum value is larger than maximum value (as long as it has a limit defined), or if minimum value is less than 1.
-