Class BaseFingerprintPositionAndRadioSourceEstimator<P extends com.irurueta.geometry.Point<?>,L extends BaseFingerprintPositionAndRadioSourceEstimatorListener<?>>
java.lang.Object
com.irurueta.navigation.indoor.fingerprint.BaseFingerprintPositionAndRadioSourceEstimator<P,L>
- Type Parameters:
P- aPointtype.L- aBaseFingerprintPositionAndRadioSourceEstimatorListenertype.
- Direct Known Subclasses:
FingerprintPositionAndRadioSourceEstimator
public abstract class BaseFingerprintPositionAndRadioSourceEstimator<P extends com.irurueta.geometry.Point<?>,L extends BaseFingerprintPositionAndRadioSourceEstimatorListener<?>>
extends Object
Base class for position and radio source estimators based on located fingerprints
containing only RSSI readings without any prior knowledge of radio sources.
-
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 List<RadioSourceLocated<P>> Radio sources provided along with located fingerprints containing their estimated locations.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 or -1 if there is no limit and all required fingerprints are initially used.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.protectedBaseFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint) Constructor.protectedBaseFingerprintPositionAndRadioSourceEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource, ? extends RssiReading<? extends RadioSource>, P>> locatedFingerprints, RssiFingerprint<? extends RadioSource, ? extends RssiReading<? extends RadioSource>> fingerprint, L listener) Constructor.protectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PCreate a point.abstract voidestimate()Starts estimation of position of unknown fingerprint and position of all radio sources associated to located fingerprints.Gets radio sources provided along with located fingerprints containing their estimated locations.Gets estimated position or null if not available yet.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.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.
-
Field Details
-
DEFAULT_MIN_NEAREST_FINGERPRINTS
public static final int DEFAULT_MIN_NEAREST_FINGERPRINTSDefault minimum number of nearest fingerprints to search. This is the minimum required value to be used for the estimation of all radio sources and fingerprint position.- 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 or -1 if there is no limit and all required fingerprints are initially used. -
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. -
estimatedLocatedSources
protected List<RadioSourceLocated<P extends com.irurueta.geometry.Point<?>>> estimatedLocatedSourcesRadio sources provided along with located fingerprints containing their estimated locations. -
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
-
BaseFingerprintPositionAndRadioSourceEstimator
protected BaseFingerprintPositionAndRadioSourceEstimator()Constructor. -
BaseFingerprintPositionAndRadioSourceEstimator
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, -1 indicates to initially use all fingerprints needed to estimate available radio sources.
-
getMaxNearestFingerprints
public int getMaxNearestFingerprints()Gets maximum number of nearest fingerprints to search.- Returns:
- maximum number of nearest fingerprints, -1 indicates to use all available fingerprints.
-
setMinMaxNearestFingerprints
public void setMinMaxNearestFingerprints(int minNearestFingerprints, int maxNearestFingerprints) throws com.irurueta.navigation.LockedException Sets minimum and maximum number of nearest fingerprints to search. If minimum value is -1, then the minimum required number of fingerprints needed to estimate available radio sources is used. If maximum value is -1, then the problem is attempted to be solved until all available fingerprints are used.- Parameters:
minNearestFingerprints- minimum number of nearest fingerprints or -1.maxNearestFingerprints- maximum number of nearest fingerprints or -1.- 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 maximum value is not negative when minimum one is less than 1, or if minimum value is zero.
-
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.
-
getEstimatedPosition
Gets estimated position or null if not available yet.- Returns:
- estimated position or null.
-
getEstimatedLocatedSources
Gets radio sources provided along with located fingerprints containing their estimated locations.- Returns:
- radio sources containing estimated locations.
-
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.
-
isReady
public boolean isReady()Indicates whether estimator is ready to find a solution.- Returns:
- true if estimator is ready, false otherwise.
-
getNumberOfDimensions
public abstract int getNumberOfDimensions()Gets number of dimensions of points.- Returns:
- number of dimensions of points.
-
estimate
public abstract void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, FingerprintEstimationExceptionStarts estimation of position of unknown fingerprint and position of all radio sources associated to located fingerprints.- 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.
-
createPoint
Create a point.- Returns:
- point to be created.
-
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.
-
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 maximum value is not negative when minimum one is less than 1.
-