Class PROMedSRobustRangingPositionEstimator2D

java.lang.Object
com.irurueta.navigation.indoor.position.RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
com.irurueta.navigation.indoor.position.RobustRangingPositionEstimator<com.irurueta.geometry.Point2D>
com.irurueta.navigation.indoor.position.RobustRangingPositionEstimator2D
com.irurueta.navigation.indoor.position.PROMedSRobustRangingPositionEstimator2D

public class PROMedSRobustRangingPositionEstimator2D extends RobustRangingPositionEstimator2D
Robustly estimates 2D position using located radio sources and their ranging readings at unknown locations and using PROMedS algorithm to discard outliers. This kind of estimator can be used to robustly determine the 2D position of a given device by getting readings at an unknown location of different radio sources whose 2D locations are known.
  • Field Details

    • sourceQualityScores

      private double[] sourceQualityScores
      Quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
    • fingerprintReadingsQualityScores

      private double[] fingerprintReadingsQualityScores
      Quality scores corresponding to each reading within provided fingerprint. The larger the score value the better the quality of the reading.
  • Constructor Details

    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D()
      Constructor.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources)
      Constructor.
      Parameters:
      sources - located radio sources used for lateration.
      Throws:
      IllegalArgumentException - if provided sources is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint)
      Constructor.
      Parameters:
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if provided fingerprint is null.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint)
      Constructor.
      Parameters:
      sources - located radio sources used for lateration.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if either provided sources or fingerprint is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      listener - listener in charge of handling events.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sources - located radio sources used for lateration.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if provided sources is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      fingerprint - fingerprint containing ranging readings at an unknown location for provided location radio sources.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if provided fingerprint is null.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sources - located radio sources used for lateration.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if either provided sources or fingerprint is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      sources - located radio sources used for lateration.
      Throws:
      IllegalArgumentException - if provided sources is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if provided fingerprint is null.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      sources - located radio sources used for lateration.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if either provided sources or fingerprint is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      listener - listener in charge of handling events.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      sources - located radio sources used for lateration.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if provided sources is null or the number of provided sources is less than the required minimum.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided location radio sources.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if provided fingerprint is null.
    • PROMedSRobustRangingPositionEstimator2D

      public PROMedSRobustRangingPositionEstimator2D(double[] sourceQualityScores, double[] fingerprintReadingsQualityScores, List<? extends RadioSourceLocated<com.irurueta.geometry.Point2D>> sources, RangingFingerprint<? extends RadioSource,? extends RangingReading<? extends RadioSource>> fingerprint, RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      sourceQualityScores - quality scores corresponding to each provided located radio source. The larger the score value the better the quality of the radio source.
      fingerprintReadingsQualityScores - quality scores corresponding to readings within provided fingerprint. The larger the score the better the quality of the reading.
      sources - located radio sources used for lateration.
      fingerprint - fingerprint containing ranging readings at an unknown location for provided located radio sources.
      listener - listener in charge of handling events.
      Throws:
      IllegalArgumentException - if either provided sources or fingerprint is null or the number of provided sources is less than the required minimum.
  • Method Details

    • getSourceQualityScores

      public double[] getSourceQualityScores()
      Returns quality scores corresponding to each radio source. The larger the score value the better the quality of the sample.
      Overrides:
      getSourceQualityScores in class RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
      Returns:
      quality scores corresponding to each radio source.
    • setSourceQualityScores

      public void setSourceQualityScores(double[] sourceQualityScores) throws com.irurueta.navigation.LockedException
      Sets quality scores corresponding to each radio source. The larger the score value the better the quality of the radio source.
      Overrides:
      setSourceQualityScores in class RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
      Parameters:
      sourceQualityScores - quality scores corresponding to each radio source.
      Throws:
      com.irurueta.navigation.LockedException - if this instance is locked.
      IllegalArgumentException - if provided quality scores length is smaller than minimum required samples.
    • getFingerprintReadingsQualityScores

      public double[] getFingerprintReadingsQualityScores()
      Gets quality scores corresponding to each reading within provided fingerprint. The larger the score value the better the quality of the reading. This implementation always returns null. Subclasses using quality scores must implement proper behavior.
      Overrides:
      getFingerprintReadingsQualityScores in class RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
      Returns:
      quality scores corresponding to each reading within provided fingerprint.
    • setFingerprintReadingsQualityScores

      public void setFingerprintReadingsQualityScores(double[] fingerprintReadingsQualityScores) throws com.irurueta.navigation.LockedException
      Sets quality scores corresponding to each reading within provided fingerprint. The larger the score value the better the quality of the reading. This implementation makes no action. Subclasses using quality scores must implement proper behavior.
      Overrides:
      setFingerprintReadingsQualityScores in class RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
      Parameters:
      fingerprintReadingsQualityScores - quality scores corresponding to each reading within provided fingerprint.
      Throws:
      com.irurueta.navigation.LockedException - if this instance is locked.
      IllegalArgumentException - if provided quality scores length is smaller than minimum required samples.
    • getStopThreshold

      public double getStopThreshold()
      Returns threshold to be used to keep the algorithm iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm to iterate too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
      Returns:
      stop threshold to stop the algorithm prematurely when a certain accuracy has been reached.
    • setStopThreshold

      public void setStopThreshold(double stopThreshold) throws com.irurueta.navigation.LockedException
      Sets threshold to be used to keep the algorithm iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm to iterate too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
      Parameters:
      stopThreshold - stop threshold to stop the algorithm prematurely when a certain accuracy has been reached.
      Throws:
      IllegalArgumentException - if provided value is zero or negative.
      com.irurueta.navigation.LockedException - if this solver is locked.
    • getMethod

      public com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Specified by:
      getMethod in class RobustPositionEstimator<com.irurueta.geometry.Point2D,RangingReading<? extends RadioSource>,RobustRangingPositionEstimatorListener<com.irurueta.geometry.Point2D>>
      Returns:
      method being used for robust estimation.
    • init

      private void init()
      Initializes robust lateration solver.
    • internalSetSourceQualityScores

      private void internalSetSourceQualityScores(double[] sourceQualityScores)
      Sets quality scores corresponding to each provided located radio source. This method is used internally and does not check whether instance is locked or not.
      Parameters:
      sourceQualityScores - quality scores to be set.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than 3 samples.
    • internalSetFingerprintReadingsQualityScores

      private void internalSetFingerprintReadingsQualityScores(double[] fingerprintReadingsQualityScores)
      Sets quality scores corresponding to each provided reading within provided fingerprint. This method is used internally and does not check whether instance is locked or not.
      Parameters:
      fingerprintReadingsQualityScores - quality scores to be set.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than 3 samples.