Class PROSACRobustRangingRadioSourceEstimator2D<S extends RadioSource>

java.lang.Object
com.irurueta.navigation.indoor.radiosource.RobustRadioSourceEstimator<com.irurueta.geometry.Point2D,RangingReadingLocated<S,com.irurueta.geometry.Point2D>,RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D>>
com.irurueta.navigation.indoor.radiosource.RobustRangingRadioSourceEstimator<S,com.irurueta.geometry.Point2D>
com.irurueta.navigation.indoor.radiosource.RobustRangingRadioSourceEstimator2D<S>
com.irurueta.navigation.indoor.radiosource.PROSACRobustRangingRadioSourceEstimator2D<S>
Type Parameters:
S - a RadioSource type.

public class PROSACRobustRangingRadioSourceEstimator2D<S extends RadioSource> extends RobustRangingRadioSourceEstimator2D<S>
Robustly estimated 2D position of a radio source (e.g. Wi-Fi access point or bluetooth beacon), by discarding outliers using PROSAC algorithm.
  • Field Details

    • DEFAULT_THRESHOLD

      public static final double DEFAULT_THRESHOLD
      Constant defining default threshold to determine whether samples are inliers or not.
      See Also:
    • MIN_THRESHOLD

      public static final double MIN_THRESHOLD
      Minimum value that can be set as threshold. Threshold must be strictly greater than 0.0.
      See Also:
    • DEFAULT_COMPUTE_AND_KEEP_INLIERS

      public static final boolean DEFAULT_COMPUTE_AND_KEEP_INLIERS
      Indicates that by default inliers will only be computed but not kept.
      See Also:
    • DEFAULT_COMPUTE_AND_KEEP_RESIDUALS

      public static final boolean DEFAULT_COMPUTE_AND_KEEP_RESIDUALS
      Indicates that by default residuals will only be computed but not kept.
      See Also:
    • threshold

      private double threshold
      Threshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample.
    • computeAndKeepInliers

      private boolean computeAndKeepInliers
      Indicates whether inliers must be computed and kept.
    • computeAndKeepResiduals

      private boolean computeAndKeepResiduals
      Indicates whether residuals must be computed and kept.
    • qualityScores

      private double[] qualityScores
      Quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
  • Constructor Details

    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D()
      Constructor.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      readings - radio signal ranging readings belonging to the same radio source.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      listener - listener in charge of attending events raised by this instance.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      readings - radio 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.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(com.irurueta.geometry.Point2D initialPosition)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation or radio source position.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, com.irurueta.geometry.Point2D initialPosition)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      readings - radio 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.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(com.irurueta.geometry.Point2D initialPosition, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> 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.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, com.irurueta.geometry.Point2D initialPosition, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      readings - radio signal ranging 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.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      Throws:
      IllegalArgumentException - if quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      readings - radio signal ranging readings belonging to the same radio source.
      Throws:
      IllegalArgumentException - if readings are not valid, quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      readings - radio 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, quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, com.irurueta.geometry.Point2D initialPosition)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      initialPosition - initial position to start the estimation or radio source position.
      Throws:
      IllegalArgumentException - if quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, com.irurueta.geometry.Point2D initialPosition)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      readings - radio 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, quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, com.irurueta.geometry.Point2D initialPosition, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      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, quality scores is null, or length of quality scores is less than required minimum.
    • PROSACRobustRangingRadioSourceEstimator2D

      public PROSACRobustRangingRadioSourceEstimator2D(double[] qualityScores, List<? extends RangingReadingLocated<S,com.irurueta.geometry.Point2D>> readings, com.irurueta.geometry.Point2D initialPosition, RobustRangingRadioSourceEstimatorListener<S,com.irurueta.geometry.Point2D> listener)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      readings - radio signal ranging 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, quality scores is null, or length of quality scores is less than required minimum.
  • Method Details

    • getThreshold

      public double getThreshold()
      Gets threshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample.
      Returns:
      threshold to determine whether samples are inliers or not.
    • setThreshold

      public void setThreshold(double threshold) throws com.irurueta.navigation.LockedException
      Sets threshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample.
      Parameters:
      threshold - threshold to determine whether samples are inliers or not.
      Throws:
      IllegalArgumentException - if provided value is equal or less than zero.
      com.irurueta.navigation.LockedException - if this solver is locked.
    • getQualityScores

      public double[] getQualityScores()
      Returns quality scores corresponding to each pair of positions and distances (i.e. sample). The larger the score value the better the quality of the sample. This implementation always returns null. Subclasses using quality scores must implement proper behavior.
      Overrides:
      getQualityScores in class RobustRadioSourceEstimator<com.irurueta.geometry.Point2D,RangingReadingLocated<S extends RadioSource,com.irurueta.geometry.Point2D>,RobustRangingRadioSourceEstimatorListener<S extends RadioSource,com.irurueta.geometry.Point2D>>
      Returns:
      quality scores corresponding to each sample.
    • setQualityScores

      public void setQualityScores(double[] qualityScores) throws com.irurueta.navigation.LockedException
      Sets quality scores corresponding to each pair of positions and distances (i.e. sample). The larger the score value the better the quality of the sample. This implementation makes no action. Subclasses using quality scores must implement proper behaviour.
      Overrides:
      setQualityScores in class RobustRadioSourceEstimator<com.irurueta.geometry.Point2D,RangingReadingLocated<S extends RadioSource,com.irurueta.geometry.Point2D>,RobustRangingRadioSourceEstimatorListener<S extends RadioSource,com.irurueta.geometry.Point2D>>
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than minimum required samples.
      com.irurueta.navigation.LockedException - if robust solver is locked because an estimation is already in progress.
    • isReady

      public boolean isReady()
      Indicates whether solver is ready to find a solution.
      Overrides:
      isReady in class RobustRangingRadioSourceEstimator<S extends RadioSource,com.irurueta.geometry.Point2D>
      Returns:
      true if solver is ready, false otherwise.
    • isComputeAndKeepInliersEnabled

      public boolean isComputeAndKeepInliersEnabled()
      Indicates whether inliers must be computed and kept.
      Returns:
      true if inliers must be computed and kept, false if inliers only need to be computed but not kept.
    • setComputeAndKeepInliersEnabled

      public void setComputeAndKeepInliersEnabled(boolean computeAndKeepInliers) throws com.irurueta.navigation.LockedException
      Specifies whether inliers must be computed and kept.
      Parameters:
      computeAndKeepInliers - true if inliers must be computed and kept, false if inliers only need to be computed but not kept.
      Throws:
      com.irurueta.navigation.LockedException - if this solver is locked.
    • isComputeAndKeepResidualsEnabled

      public boolean isComputeAndKeepResidualsEnabled()
      Indicates whether residuals must be computed and kept.
      Returns:
      true if residuals must be computed and kept, false if residuals only need to be computed but not kept.
    • setComputeAndKeepResidualsEnabled

      public void setComputeAndKeepResidualsEnabled(boolean computeAndKeepResiduals) throws com.irurueta.navigation.LockedException
      Specifies whether residuals must be computed and kept.
      Parameters:
      computeAndKeepResiduals - true if residuals must be computed and kept, false if residuals only need to be computed but not kept.
      Throws:
      com.irurueta.navigation.LockedException - if this solver is locked.
    • estimate

      public void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Robustly estimates position for a radio source.
      Specified by:
      estimate in class RobustRadioSourceEstimator<com.irurueta.geometry.Point2D,RangingReadingLocated<S extends RadioSource,com.irurueta.geometry.Point2D>,RobustRangingRadioSourceEstimatorListener<S extends RadioSource,com.irurueta.geometry.Point2D>>
      Throws:
      com.irurueta.navigation.LockedException - if instance is busy during estimation.
      com.irurueta.navigation.NotReadyException - if estimator is not ready.
      com.irurueta.numerical.robust.RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getMethod

      public com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Specified by:
      getMethod in class RobustRangingRadioSourceEstimator<S extends RadioSource,com.irurueta.geometry.Point2D>
      Returns:
      method being used for robust estimation.
    • internalSetQualityScores

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