Class RobustRssiRadioSourceEstimator<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>

java.lang.Object
com.irurueta.navigation.indoor.radiosource.RobustRadioSourceEstimator<P,RssiReadingLocated<S,P>,RobustRssiRadioSourceEstimatorListener<S,P>>
com.irurueta.navigation.indoor.radiosource.RobustRssiRadioSourceEstimator<S,P>
Type Parameters:
S - a RadioSource type.
P - a Point type.
Direct Known Subclasses:
RobustRssiRadioSourceEstimator2D, RobustRssiRadioSourceEstimator3D

public abstract class RobustRssiRadioSourceEstimator<S extends RadioSource,P extends com.irurueta.geometry.Point<P>> extends RobustRadioSourceEstimator<P,RssiReadingLocated<S,P>,RobustRssiRadioSourceEstimatorListener<S,P>>
This is an abstract class to robustly estimate position, transmitted power and path-loss exponent of a radio source (e.g. Wi-Fi access point or bluetooth beacon), by discarding outliers and assuming that the radio source emits isotropically following the expression below: Pr = Pt*Gt*Gr*lambda^2 / (4*pi*d)^2, where Pr is the received power (expressed in mW), Gt is the Gain of the transmission antenna Gr is the Gain of the receiver antenna d is the distance between emitter and receiver and lambda is the wavelength and is equal to: lambda = c / f, where c is the speed of light and f is the carrier frequency of the radio signal. Because usually information about the antenna of the radio source cannot be retrieved (because many measurements are made on unknown devices where physical access is not possible), this implementation will estimate the equivalent transmitted power as: Pte = Pt * Gt * Gr. If RssiReadings contain RSSI standard deviations, those values will be used, otherwise it will be assumed an RSSI standard deviation of 1 dB. Implementations of this class should be able to detect and discard outliers in order to find the best solution.

IMPORTANT: Implementations of this class can choose to estimate a combination of radio source position, transmitted power and path loss exponent. However enabling all three estimations usually achieves inaccurate results. When using this class, estimation must be of at least one parameter (position, transmitted power or path loss exponent) when initial values are provided for the other two, and at most it should consist of two parameters (either position and transmitted power, position and path loss exponent or transmitted power and path loss exponent), providing an initial value for the remaining parameter.

  • Field Details

    • initialTransmittedPowerdBm

      protected Double initialTransmittedPowerdBm
      Initial transmitted power to start the estimation of radio source transmitted power. If not defined, average value of received power readings will be used.
    • initialPosition

      protected P extends com.irurueta.geometry.Point<P> initialPosition
      Initial position to start the estimation of radio source position. If not defined, centroid of provided located readings will be used.
    • initialPathLossExponent

      protected double initialPathLossExponent
      Initial exponent 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

      If path loss exponent estimation is enabled, estimation will start at this value and will converge to the most appropriate value. If path loss exponent estimation is disabled, this value will be assumed to be exact and the estimated path loss exponent will be equal to this value.

    • transmittedPowerEstimationEnabled

      protected boolean transmittedPowerEstimationEnabled
      Indicates whether transmitted power estimation is enabled or not.
    • positionEstimationEnabled

      protected boolean positionEstimationEnabled
      Indicates whether radio source position estimation is enabled or not.
    • pathLossEstimationEnabled

      protected boolean pathLossEstimationEnabled
      Indicates whether path loss estimation is enabled or not.
    • estimatedTransmittedPowerdBm

      protected double estimatedTransmittedPowerdBm
      Estimated transmitted power expressed in dBm's.
    • estimatedPathLossExponent

      protected double estimatedPathLossExponent
      Estimated exponent 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 If path loss exponent estimation is not enabled, this value will always be equal to RssiRadioSourceEstimator.DEFAULT_PATH_LOSS_EXPONENT
    • estimatedTransmittedPowerVariance

      protected Double estimatedTransmittedPowerVariance
      Variance of estimated transmitted power. This value will only be available when transmitted power estimation is enabled.
    • estimatedPathLossExponentVariance

      protected Double estimatedPathLossExponentVariance
      Variance of estimated path loss exponent. This value will only be available when path-loss exponent estimation is enabled.
  • Constructor Details

    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator()
      Constructor.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      listener - listener in charge of attending events raised by this instance.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      listener - listener in charge of attending events raised by this instance.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(Double initialTransmittedPowerdBm)
      Constructor.
      Parameters:
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's)
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, Double initialTransmittedPowerdBm)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's)
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(Double initialTransmittedPowerdBm, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's)
      listener - listener in charge of attending events raised by this instance.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, Double initialTransmittedPowerdBm, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's)
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition, Double initialTransmittedPowerdBm)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition, Double initialTransmittedPowerdBm)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition, Double initialTransmittedPowerdBm, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      listener - in charge of attending events raised by this instance.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition, Double initialTransmittedPowerdBm, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition, Double initialTransmittedPowerdBm, double initialPathLossExponent)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      initialPathLossExponent - initial path loss exponent. A typical value is 2.0.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition, Double initialTransmittedPowerdBm, double initialPathLossExponent)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      initialPathLossExponent - initial path loss exponent. A typical value is 2.0.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(P initialPosition, Double initialTransmittedPowerdBm, double initialPathLossExponent, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      initialPathLossExponent - initial path loss exponent. A typical value is 2.0.
      listener - listener in charge of attending events raised by this instance.
    • RobustRssiRadioSourceEstimator

      protected RobustRssiRadioSourceEstimator(List<? extends RssiReadingLocated<S,P>> readings, P initialPosition, Double initialTransmittedPowerdBm, double initialPathLossExponent, RobustRssiRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets signal readings belonging to the same radio source.
      Parameters:
      readings - signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's).
      initialPathLossExponent - initial path loss exponent. A typical value is 2.0.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
  • Method Details

    • getInitialTransmittedPowerdBm

      public Double getInitialTransmittedPowerdBm()
      Gets initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's). If not defined, average value of received power readings will be used.
      Returns:
      initial transmitted power to start the estimation of radio source transmitted power.
    • setInitialTransmittedPowerdBm

      public void setInitialTransmittedPowerdBm(Double initialTransmittedPowerdBm) throws com.irurueta.navigation.LockedException
      Sets initial transmitted power to start the estimation of radio source transmitted power (expressed in dBm's). If not defined, average value of received power readings will be used.
      Parameters:
      initialTransmittedPowerdBm - initial transmitted power to start the estimation of radio source transmitted power.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • getInitialTransmittedPower

      public Double getInitialTransmittedPower()
      Gets initial transmitted power to start the estimation of radio source transmitted power (expressed in mW). If not defined, average value of received power readings will be used.
      Returns:
      initial transmitted power to start the estimation of radio source transmitted power.
    • setInitialTransmittedPower

      public void setInitialTransmittedPower(Double initialTransmittedPower) throws com.irurueta.navigation.LockedException
      Sets initial transmitted power to start the estimation of radio source transmitted power (expressed in mW). If not defined, average value of received power readings will be used.
      Parameters:
      initialTransmittedPower - initial transmitted power to start the estimation of radio source transmitted power.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
      IllegalArgumentException - if provided value is negative.
    • getInitialPosition

      public P getInitialPosition()
      Gets initial position to start the estimation of radio source position. If not defined, centroid of provided fingerprints will be used.
      Returns:
      initial position to start the estimation of radio source position.
    • setInitialPosition

      public void setInitialPosition(P initialPosition) throws com.irurueta.navigation.LockedException
      Sets initial position to start the estimation of radio source position. If not defined, centroid of provided fingerprints will be used.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • getInitialPathLossExponent

      public double getInitialPathLossExponent()
      Gets initial exponent typically used on free space for path loss propagation in terms of distance. On different environments path loss exponent might have different value: - 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

      If path loss exponent estimation is enabled, estimation will start at this value and will converge to the most appropriate value. If path loss exponent estimation is disabled, this value will be assumed to be exact and the estimated path loss exponent will be equal to this value.

      Returns:
      initial path loss exponent.
    • setInitialPathLossExponent

      public void setInitialPathLossExponent(double initialPathLossExponent) throws com.irurueta.navigation.LockedException
      Sets initial exponent typically used on free space for path loss propagation in terms of distance. On different environments path loss exponent might have different value: - 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

      If path loss exponent estimation is enabled, estimation will start at this value and will converge to the most appropriate value. If path loss exponent estimation is disabled, this value will be assumed to be exact and the estimated path loss exponent will be equal to this value.

      Parameters:
      initialPathLossExponent - initial path loss exponent.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isTransmittedPowerEstimationEnabled

      public boolean isTransmittedPowerEstimationEnabled()
      Indicates whether transmitted power estimation is enabled or not.
      Returns:
      true if transmitted power estimation is enabled, false otherwise.
    • setTransmittedPowerEstimationEnabled

      public void setTransmittedPowerEstimationEnabled(boolean transmittedPowerEstimationEnabled) throws com.irurueta.navigation.LockedException
      Specifies whether transmitted power estimation is enabled or not.
      Parameters:
      transmittedPowerEstimationEnabled - true if transmitted power estimation is enabled, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isPositionEstimationEnabled

      public boolean isPositionEstimationEnabled()
      Indicates whether radio source position estimation is enabled or not.
      Returns:
      true if position estimation is enabled, false otherwise.
    • setPositionEstimationEnabled

      public void setPositionEstimationEnabled(boolean positionEstimationEnabled) throws com.irurueta.navigation.LockedException
      Specifies whether radio source position estimation is enabled or not.
      Parameters:
      positionEstimationEnabled - true if position estimation is enabled, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isPathLossEstimationEnabled

      public boolean isPathLossEstimationEnabled()
      Indicates whether path loss estimation is enabled or not.
      Returns:
      true if path loss estimation is enabled, false otherwise.
    • setPathLossEstimationEnabled

      public void setPathLossEstimationEnabled(boolean pathLossEstimationEnabled) throws com.irurueta.navigation.LockedException
      Specifies whether path loss estimation is enabled or not.
      Parameters:
      pathLossEstimationEnabled - true if path loss estimation is enabled, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isReady

      public boolean isReady()
      Indicates whether this instance is ready to start the estimation.
      Specified by:
      isReady in class RobustRadioSourceEstimator<P extends com.irurueta.geometry.Point<P>,RssiReadingLocated<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>,RobustRssiRadioSourceEstimatorListener<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>>
      Returns:
      true if this instance is ready, false otherwise.
    • getEstimatedTransmittedPowerVariance

      public Double getEstimatedTransmittedPowerVariance()
      Gets estimated transmitted power variance. This is only available when result has been refined and covariance is kept.
      Returns:
      estimated transmitted power variance.
    • getEstimatedPathLossExponentVariance

      public Double getEstimatedPathLossExponentVariance()
      Gets estimated path loss exponent variance. This is only available when result has been refined and covariance is kept.
      Returns:
      estimated path loss exponent variance.
    • getEstimatedTransmittedPower

      public double getEstimatedTransmittedPower()
      Gets estimated transmitted power expressed in milli watts (mW).
      Returns:
      estimated transmitted power expressed in milli watts.
    • getEstimatedTransmittedPowerdBm

      public double getEstimatedTransmittedPowerdBm()
      Gets estimated transmitted power expressed in dBm's.
      Returns:
      estimated transmitted power expressed in dBm's.
    • getEstimatedPathLossExponent

      public double getEstimatedPathLossExponent()
      Gets estimated exponent 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 If path loss exponent estimation is not enabled, this value will always be equal to RssiRadioSourceEstimator.DEFAULT_PATH_LOSS_EXPONENT
      Returns:
      estimated path loss exponent.
    • getMethod

      public abstract com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Returns:
      method being used for robust estimation.
    • solvePreliminarySolutions

      protected abstract void solvePreliminarySolutions(int[] samplesIndices, List<RobustRssiRadioSourceEstimator.Solution<P>> solutions)
      Solves preliminary solution for a subset of samples.
      Parameters:
      samplesIndices - indices of subset samples.
      solutions - instance where solution will be stored.
    • residual

      protected double residual(RobustRssiRadioSourceEstimator.Solution<P> currentEstimation, int i)
      Estimates residual for a solution obtained for a subset of samples.
      Parameters:
      currentEstimation - solution obtained for a subset of samples.
      i - i-th fingerprint to obtain residual for.
      Returns:
      difference between measured and expected RSSI value.