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

    • DEFAULT_MIN_NEAREST_FINGERPRINTS

      public static final int DEFAULT_MIN_NEAREST_FINGERPRINTS
      Default 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_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 or -1 if there is no limit and all required fingerprints are initially used.
    • 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

      Listener to be notified of events raised by this instance.
    • estimatedPositionCoordinates

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

      protected List<RadioSourceLocated<P extends com.irurueta.geometry.Point<?>>> estimatedLocatedSources
      Radio sources provided along with located fingerprints containing their estimated locations.
    • 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

    • BaseFingerprintPositionAndRadioSourceEstimator

      protected BaseFingerprintPositionAndRadioSourceEstimator()
      Constructor.
    • BaseFingerprintPositionAndRadioSourceEstimator

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

      protected BaseFingerprintPositionAndRadioSourceEstimator(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 either non located fingerprint or located fingerprints are null.
    • BaseFingerprintPositionAndRadioSourceEstimator

      protected BaseFingerprintPositionAndRadioSourceEstimator(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 either non located fingerprint or located fingerprints are null.
  • 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, -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

      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.
    • getEstimatedPosition

      public P getEstimatedPosition()
      Gets estimated position or null if not available yet.
      Returns:
      estimated position or null.
    • getEstimatedLocatedSources

      public List<RadioSourceLocated<P>> 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>,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.
    • 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, FingerprintEstimationException
      Starts 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

      protected abstract P 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.
    • 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 maximum value is not negative when minimum one is less than 1.