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 - a Point type.
L - a BaseFingerprintEstimatorListener type.
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 Details

    • DEFAULT_MIN_NEAREST_FINGERPRINTS

      public static final int DEFAULT_MIN_NEAREST_FINGERPRINTS
      Default minimum number of nearest fingerprints to search.
      See Also:
    • DEFAULT_MAX_NEAREST_FINGERPRINTS

      public static final int DEFAULT_MAX_NEAREST_FINGERPRINTS
      Default maximum number of nearest fingerprints to search (no limit).
      See Also:
    • DEFAULT_PATH_LOSS_EXPONENT

      public static final double DEFAULT_PATH_LOSS_EXPONENT
      Default 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>,P extends com.irurueta.geometry.Point<?>>> locatedFingerprints
      Located fingerprints containing RSSI readings.
    • fingerprint

      protected RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint
      Fingerprint containing readings at an unknown location. Readings need to belong to the same radio sources as those given at located fingerprints
    • minNearestFingerprints

      protected int minNearestFingerprints
      Minimum number of nearest fingerprints to search.
    • maxNearestFingerprints

      protected int maxNearestFingerprints
      Maximum number of nearest fingerprints to search or -1 if there is no limit and all provided fingerprints are used.
    • pathLossExponent

      protected double pathLossExponent
      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
    • listener

      protected L extends BaseFingerprintEstimatorListener<?> listener
      Listener to be notified of events raised by this instance.
    • estimatedPositionCoordinates

      protected double[] estimatedPositionCoordinates
      Estimated inhomogeneous position coordinates.
    • nearestFingerprints

      protected List<RssiFingerprintLocated<RadioSource,RssiReading<RadioSource>,P extends com.irurueta.geometry.Point<?>>> nearestFingerprints
      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 locked
      Indicates if this instance is locked.
  • Constructor Details

    • BaseFingerprintPositionEstimator

      protected BaseFingerprintPositionEstimator()
      Constructor.
    • BaseFingerprintPositionEstimator

      protected BaseFingerprintPositionEstimator(L listener)
      Constructor.
      Parameters:
      listener - listener in charge of handling events.
    • BaseFingerprintPositionEstimator

      protected BaseFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource,? extends RssiReading<? extends RadioSource>,P>> locatedFingerprints, RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint)
      Constructor.
      Parameters:
      locatedFingerprints - located fingerprints containing RSSI readings.
      fingerprint - fingerprint containing readings at an unknown location for provided located fingerprints.
      Throws:
      IllegalArgumentException - if provided non located fingerprint is null, located fingerprints 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).
    • BaseFingerprintPositionEstimator

      protected BaseFingerprintPositionEstimator(List<? extends RssiFingerprintLocated<? extends RadioSource,? extends RssiReading<? extends RadioSource>,P>> locatedFingerprints, RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint, L listener)
      Constructor.
      Parameters:
      locatedFingerprints - located fingerprints containing RSSI readings.
      fingerprint - fingerprint containing readings at an unknown location for provided located fingerprints.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if provided non located fingerprint is null, located fingerprints 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).
  • Method Details

    • getLocatedFingerprints

      public List<RssiFingerprintLocated<RadioSource,RssiReading<RadioSource>,P>> getLocatedFingerprints()
      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>,P>> locatedFingerprints) throws com.irurueta.navigation.LockedException
      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.
    • setFingerprint

      public void setFingerprint(RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint) throws com.irurueta.navigation.LockedException
      Sets fingerprint containing readings at an unknown location for provided located fingerprints.
      Parameters:
      fingerprint - fingerprint containing readings at an unknown location for provided located fingerprints.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
      IllegalArgumentException - if provided value is null.
    • 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

      public L getListener()
      Gets listener to be notified of events raised by this instance.
      Returns:
      listener to be notified of events raised by this instance.
    • setListener

      public void setListener(L listener) throws com.irurueta.navigation.LockedException
      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

      public void getEstimatedPosition(P estimatedPosition)
      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>,P>> getNearestFingerprints()
      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, FingerprintEstimationException
      Starts 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

      public abstract P 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).
    • internalSetFingerprint

      private void internalSetFingerprint(RssiFingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint)
      Internally sets fingerprint containing readings at an unknown location for provided located fingerprints.
      Parameters:
      fingerprint - fingerprint containing readings at an unknown location for provided located fingerprints.
      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 minimum value is less than 1.