Class RobustLaterationSolver<P extends com.irurueta.geometry.Point<?>>

java.lang.Object
com.irurueta.navigation.lateration.RobustLaterationSolver<P>
Type Parameters:
P - a Point type.
Direct Known Subclasses:
RobustLateration2DSolver, RobustLateration3DSolver

public abstract class RobustLaterationSolver<P extends com.irurueta.geometry.Point<?>> extends Object
This is an abstract class to robustly solve the lateration problem by finding the best pairs of positions and distances among the provided ones. Implementations of this class should be able to detect and discard outliers in order to find the best solution.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    Amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    protected com.irurueta.algebra.Matrix
    Estimated covariance of estimated position.
    static final double
    Constant defining default confidence of the estimated result, which is 99%.
    static final boolean
    Indicates that covariance is kept by default after refining result.
    static final int
    Default maximum allowed number of iterations.
    static final float
    Default amount of progress variation before notifying a change in estimation progress.
    static final boolean
    Indicates that by default preliminary solutions are refined.
    static final boolean
    Indicates that result is refined by default using a non-linear lateration solver (which uses Levenberg-Marquardt fitter).
    static final com.irurueta.numerical.robust.RobustEstimatorMethod
    Default robust estimator method when none is provided.
    static final boolean
    Indicates that by default an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
    private static final boolean
    Indicates that by default a linear solver is used for preliminary solution estimation.
    protected double[]
    Euclidean distances from static nodes to mobile node.
    protected double[]
    Standard deviations of provided distances.
    static final double
    Minimum allowed distance for a given circle or sphere.
    protected P
    Estimated position.
    protected P
    Initial position to use as a starting point to find a new solution.
    protected com.irurueta.numerical.robust.InliersData
    Data related to inliers found after estimation.
    protected boolean
    Indicates whether covariance must be kept after refining result.
    Listener to be notified of events such as when solving starts, ends or its progress significantly changes.
    protected boolean
    Indicates if this instance is locked because lateration is being solved.
    static final double
    Maximum allowed confidence value.
    static final float
    Maximum allowed value for progress delta.
    protected int
    Maximum allowed number of iterations.
    static final double
    Minimum allowed confidence value.
    static final int
    Minimum allowed number of iterations.
    static final float
    Minimum allowed value for progress delta.
    protected P[]
    Known positions of static nodes.
    protected int
    Size of subsets to be checked during robust estimation.
    protected float
    Amount of progress variation before notifying a progress change during estimation.
    protected boolean
    Indicates whether preliminary solutions must be refined after an initial linear solution is found.
    protected boolean
    Indicates whether result must be refined using a non-linear lateration solver over found inliers.
    protected boolean
    Indicates whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
    protected boolean
    Indicates whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Constructor.
    protected
    RobustLaterationSolver(P[] positions, double[] distances)
    Constructor.
    protected
    RobustLaterationSolver(P[] positions, double[] distances, double[] distanceStandardDeviations)
    Constructor.
    protected
    RobustLaterationSolver(P[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<P> listener)
    Constructor.
    protected
    RobustLaterationSolver(P[] positions, double[] distances, RobustLaterationSolverListener<P> listener)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    com.irurueta.algebra.Matrix
    Gets estimated covariance of estimated position if available.
    double[]
    Gets euclidean distances from static nodes to mobile node.
    double[]
    Gets standard deviations of provided distances.
    Gets estimated position.
    Gets initial position to use as a starting point to find a new solution.
    com.irurueta.numerical.robust.InliersData
    Gets data related to inliers found after estimation.
    Gets listener to be notified of events raised by this instance.
    int
    Returns maximum allowed number of iterations.
    abstract com.irurueta.numerical.robust.RobustEstimatorMethod
    Returns method being used for robust estimation.
    abstract int
    Minimum required number of positions and distances.
    abstract int
    Gets number of dimensions of provided points.
    P[]
    Gets known positions of static nodes.
    int
    Gets size of subsets to be checked during robust estimation.
    float
    Returns amount of progress variation before notifying a progress change during estimation.
    double[]
    Returns quality scores corresponding to each pair of positions and distances (i.e. sample).
    protected void
    internalSetPositionsAndDistances(P[] positions, double[] distances)
    Internally sets known positions and Euclidean distances.
    protected void
    internalSetPositionsDistancesAndStandardDeviations(P[] positions, double[] distances, double[] distanceStandardDeviations)
    Internally sets known positions, Euclidean distances and the respective standard deviations of measured distances.
    boolean
    Indicates whether covariance must be kept after refining result.
    boolean
    Indicates whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
    boolean
    Indicates whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
    boolean
    Returns boolean indicating if solver is locked because estimation is under progress.
    boolean
    Indicates whether preliminary solutions must be refined after an initial linear solution is found.
    boolean
    Indicates whether solver is ready to find a solution.
    boolean
    Indicates whether result must be refined using a non-linear solver over found inliers.
    void
    setConfidence(double confidence)
    Sets amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    void
    setCovarianceKept(boolean keepCovariance)
    Specifies whether covariance must be kept after refining result.
    void
    setHomogeneousLinearSolverUsed(boolean useHomogeneousLinearSolver)
    Specifies whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
    void
    setInitialPosition(P initialPosition)
    Sets initial position to use as a starting point to find a new solution.
    void
    setLinearSolverUsed(boolean linearSolverUsed)
    Specifies whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
    void
    Sets listener to be notified of events raised by this instance.
    void
    setMaxIterations(int maxIterations)
    Sets maximum allowed number of iterations.
    void
    setPositionsAndDistances(P[] positions, double[] distances)
    Sets known positions and Euclidean distances.
    void
    setPositionsDistancesAndStandardDeviations(P[] positions, double[] distances, double[] distanceStandardDeviations)
    Sets known positions, Euclidean distances and the respective standard deviations of measured distances.
    void
    setPreliminarySolutionRefined(boolean preliminarySolutionRefined)
    Specifies whether preliminary solutions must be refined after an initial linear solution is found.
    void
    setPreliminarySubsetSize(int preliminarySubsetSize)
    Sets size of subsets to be checked during robust estimation.
    void
    setProgressDelta(float progressDelta)
    Sets amount of progress variation before notifying a progress change during estimation.
    void
    setQualityScores(double[] qualityScores)
    Sets quality scores corresponding to each pair of positions and distances (i.e. sample).
    void
    setResultRefined(boolean refineResult)
    Specifies whether result must be refined using a non-linear solver over found inliers.
    abstract P
    Solves the lateration problem.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_USE_LINEAR_SOLVER

      private static final boolean DEFAULT_USE_LINEAR_SOLVER
      Indicates that by default a linear solver is used for preliminary solution estimation. The result obtained on each preliminary solution might be later refined.
      See Also:
    • DEFAULT_USE_HOMOGENEOUS_LINEAR_SOLVER

      public static final boolean DEFAULT_USE_HOMOGENEOUS_LINEAR_SOLVER
      Indicates that by default an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
      See Also:
    • DEFAULT_REFINE_PRELIMINARY_SOLUTIONS

      public static final boolean DEFAULT_REFINE_PRELIMINARY_SOLUTIONS
      Indicates that by default preliminary solutions are refined.
      See Also:
    • DEFAULT_ROBUST_METHOD

      public static final com.irurueta.numerical.robust.RobustEstimatorMethod DEFAULT_ROBUST_METHOD
      Default robust estimator method when none is provided.
    • DEFAULT_REFINE_RESULT

      public static final boolean DEFAULT_REFINE_RESULT
      Indicates that result is refined by default using a non-linear lateration solver (which uses Levenberg-Marquardt fitter).
      See Also:
    • DEFAULT_KEEP_COVARIANCE

      public static final boolean DEFAULT_KEEP_COVARIANCE
      Indicates that covariance is kept by default after refining result.
      See Also:
    • DEFAULT_PROGRESS_DELTA

      public static final float DEFAULT_PROGRESS_DELTA
      Default amount of progress variation before notifying a change in estimation progress. By default, this is set to 5%.
      See Also:
    • MIN_PROGRESS_DELTA

      public static final float MIN_PROGRESS_DELTA
      Minimum allowed value for progress delta.
      See Also:
    • MAX_PROGRESS_DELTA

      public static final float MAX_PROGRESS_DELTA
      Maximum allowed value for progress delta.
      See Also:
    • DEFAULT_CONFIDENCE

      public static final double DEFAULT_CONFIDENCE
      Constant defining default confidence of the estimated result, which is 99%. This means that with a probability of 99% estimation will be accurate because chosen sub-samples will be inliers.
      See Also:
    • DEFAULT_MAX_ITERATIONS

      public static final int DEFAULT_MAX_ITERATIONS
      Default maximum allowed number of iterations.
      See Also:
    • MIN_CONFIDENCE

      public static final double MIN_CONFIDENCE
      Minimum allowed confidence value.
      See Also:
    • MAX_CONFIDENCE

      public static final double MAX_CONFIDENCE
      Maximum allowed confidence value.
      See Also:
    • MIN_ITERATIONS

      public static final int MIN_ITERATIONS
      Minimum allowed number of iterations.
      See Also:
    • EPSILON

      public static final double EPSILON
      Minimum allowed distance for a given circle or sphere.
      See Also:
    • positions

      protected P extends com.irurueta.geometry.Point<?>[] positions
      Known positions of static nodes.
    • distances

      protected double[] distances
      Euclidean distances from static nodes to mobile node.
    • listener

      protected RobustLaterationSolverListener<P extends com.irurueta.geometry.Point<?>> listener
      Listener to be notified of events such as when solving starts, ends or its progress significantly changes.
    • initialPosition

      protected P extends com.irurueta.geometry.Point<?> initialPosition
      Initial position to use as a starting point to find a new solution. This is optional, but if provided, when no linear solvers are used, this is taken into account. If linear solvers are used, this is ignored.
    • useLinearSolver

      protected boolean useLinearSolver
      Indicates whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
    • useHomogeneousLinearSolver

      protected boolean useHomogeneousLinearSolver
      Indicates whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
    • refinePreliminarySolutions

      protected boolean refinePreliminarySolutions
      Indicates whether preliminary solutions must be refined after an initial linear solution is found.
    • estimatedPosition

      protected P extends com.irurueta.geometry.Point<?> estimatedPosition
      Estimated position.
    • locked

      protected boolean locked
      Indicates if this instance is locked because lateration is being solved.
    • progressDelta

      protected float progressDelta
      Amount of progress variation before notifying a progress change during estimation.
    • confidence

      protected double confidence
      Amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
    • maxIterations

      protected int maxIterations
      Maximum allowed number of iterations. When the maximum number of iterations is exceeded, result will not be available, however an approximate result will be available for retrieval.
    • inliersData

      protected com.irurueta.numerical.robust.InliersData inliersData
      Data related to inliers found after estimation.
    • refineResult

      protected boolean refineResult
      Indicates whether result must be refined using a non-linear lateration solver over found inliers. If true, inliers will be computed and kept in any implementation regardless of the settings.
    • keepCovariance

      protected boolean keepCovariance
      Indicates whether covariance must be kept after refining result. This setting is only taken into account if result is refined.
    • covariance

      protected com.irurueta.algebra.Matrix covariance
      Estimated covariance of estimated position. This is only available when result has been refined and covariance is kept.
    • distanceStandardDeviations

      protected double[] distanceStandardDeviations
      Standard deviations of provided distances.
    • preliminarySubsetSize

      protected int preliminarySubsetSize
      Size of subsets to be checked during robust estimation.
  • Constructor Details

    • RobustLaterationSolver

      protected RobustLaterationSolver()
      Constructor.
    • RobustLaterationSolver

      protected RobustLaterationSolver(RobustLaterationSolverListener<P> listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • RobustLaterationSolver

      protected RobustLaterationSolver(P[] positions, double[] distances)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 for 2D points or 4 for 3D points).
    • RobustLaterationSolver

      protected RobustLaterationSolver(P[] positions, double[] distances, double[] distanceStandardDeviations)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if either positions, distances or standard deviations are null, don't have the same length or their length is smaller than required (3 for 2D points or 4 for 3D points).
    • RobustLaterationSolver

      protected RobustLaterationSolver(P[] positions, double[] distances, RobustLaterationSolverListener<P> listener)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 for 2D points or 4 for 3D points).
    • RobustLaterationSolver

      protected RobustLaterationSolver(P[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<P> listener)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      distanceStandardDeviations - standard deviations of provided measured distances.
      listener - listener to be notified of events raised by this instance.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 for 2D points or 4 for 3D points).
  • Method Details

    • getListener

      public RobustLaterationSolverListener<P> 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(RobustLaterationSolverListener<P> listener) throws 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:
      LockedException - if instance is busy solving the lateration problem.
    • getInitialPosition

      public P getInitialPosition()
      Gets initial position to use as a starting point to find a new solution. This is optional, but if provided, when no linear solvers are used, this is taken into account. If linear solvers are used, this is ignored.
      Returns:
      an initial position.
    • setInitialPosition

      public void setInitialPosition(P initialPosition) throws LockedException
      Sets initial position to use as a starting point to find a new solution. This is optional, but if provided, when no linear solvers are used, this is taken into account. If linear solvers are used, this is ignored.
      Parameters:
      initialPosition - an initial position.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
    • isLinearSolverUsed

      public boolean isLinearSolverUsed()
      Indicates whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
      Returns:
      true if a linear solver is used, false otherwise.
    • setLinearSolverUsed

      public void setLinearSolverUsed(boolean linearSolverUsed) throws LockedException
      Specifies whether a linear solver is used or not (either homogeneous or inhomogeneous) for preliminary solutions.
      Parameters:
      linearSolverUsed - true if a linear solver is used, false otherwise.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
    • isHomogeneousLinearSolverUsed

      public boolean isHomogeneousLinearSolverUsed()
      Indicates whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
      Returns:
      true if homogeneous linear solver is used, false otherwise.
    • setHomogeneousLinearSolverUsed

      public void setHomogeneousLinearSolverUsed(boolean useHomogeneousLinearSolver) throws LockedException
      Specifies whether an homogeneous linear solver is used either to estimate preliminary solutions or an initial solution for preliminary solutions that will be later refined.
      Parameters:
      useHomogeneousLinearSolver - true if homogeneous linear solver is used, false otherwise.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
    • isPreliminarySolutionRefined

      public boolean isPreliminarySolutionRefined()
      Indicates whether preliminary solutions must be refined after an initial linear solution is found. If no initial solution is found using a linear solver, a non-linear solver will be used regardless of this value using an average solution as the initial value to be refined.
      Returns:
      true if preliminary solutions must be refined after an initial linear solution, false otherwise.
    • setPreliminarySolutionRefined

      public void setPreliminarySolutionRefined(boolean preliminarySolutionRefined) throws LockedException
      Specifies whether preliminary solutions must be refined after an initial linear solution is found. If no initial solution is found using a linear solver, a non-linear solver will be used regardless of this value using an average solution as the initial value to be refined.
      Parameters:
      preliminarySolutionRefined - true if preliminary solutions must be refined after an initial linear solution, false otherwise.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
    • isLocked

      public boolean isLocked()
      Returns boolean indicating if solver is locked because estimation is under progress.
      Returns:
      true if solver is locked, false otherwise.
    • getProgressDelta

      public float getProgressDelta()
      Returns amount of progress variation before notifying a progress change during estimation.
      Returns:
      amount of progress variation before notifying a progress change during estimation.
    • setProgressDelta

      public void setProgressDelta(float progressDelta) throws LockedException
      Sets amount of progress variation before notifying a progress change during estimation.
      Parameters:
      progressDelta - amount of progress variation before notifying a progress change during estimation.
      Throws:
      IllegalArgumentException - if progress delta is less than zero or greater than 1.
      LockedException - if this solver is locked because an estimation is being computed.
    • getConfidence

      public double getConfidence()
      Returns amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
      Returns:
      amount of confidence as a value between 0.0 and 1.0.
    • setConfidence

      public void setConfidence(double confidence) throws LockedException
      Sets amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
      Parameters:
      confidence - confidence to be set as a value between 0.0 and 1.0.
      Throws:
      IllegalArgumentException - if provided value is not between 0.0 and 1.0.
      LockedException - if solver is locked because an estimation is being computed.
    • getMaxIterations

      public int getMaxIterations()
      Returns maximum allowed number of iterations. If maximum allowed number of iterations is achieved without converging to a result when calling solve(), a RobustEstimatorException will be raised.
      Returns:
      maximum allowed number of iterations.
    • setMaxIterations

      public void setMaxIterations(int maxIterations) throws LockedException
      Sets maximum allowed number of iterations. When the maximum number of iterations is exceeded, result will not be available, however an approximate result will be available for retrieval.
      Parameters:
      maxIterations - maximum allowed number of iterations to be set.
      Throws:
      IllegalArgumentException - if provided value is less than 1.
      LockedException - if this solver is locked because an estimation is being computed.
    • getInliersData

      public com.irurueta.numerical.robust.InliersData getInliersData()
      Gets data related to inliers found after estimation.
      Returns:
      data related to inliers found after estimation.
    • isResultRefined

      public boolean isResultRefined()
      Indicates whether result must be refined using a non-linear solver over found inliers.
      Returns:
      true to refine result, false to simply use result found by robust estimator without further refining.
    • setResultRefined

      public void setResultRefined(boolean refineResult) throws LockedException
      Specifies whether result must be refined using a non-linear solver over found inliers.
      Parameters:
      refineResult - true to refine result, false to simply use result found by robust estimator without further refining.
      Throws:
      LockedException - if solver is locked.
    • isCovarianceKept

      public boolean isCovarianceKept()
      Indicates whether covariance must be kept after refining result. This setting is only taken into account if result is refined.
      Returns:
      true if covariance must be kept after refining result, false otherwise.
    • setCovarianceKept

      public void setCovarianceKept(boolean keepCovariance) throws LockedException
      Specifies whether covariance must be kept after refining result. This setting is only taken into account if result is refined.
      Parameters:
      keepCovariance - true if covariance must be kept after refining result, false otherwise.
      Throws:
      LockedException - if estimator is locked.
    • getPositions

      public P[] getPositions()
      Gets known positions of static nodes.
      Returns:
      known positions of static nodes.
    • getDistances

      public double[] getDistances()
      Gets euclidean distances from static nodes to mobile node.
      Returns:
      euclidean distances from static nodes to mobile node.
    • getDistanceStandardDeviations

      public double[] getDistanceStandardDeviations()
      Gets standard deviations of provided distances. This is used during refinement.
      Returns:
      standard deviations of provided distances.
    • isReady

      public boolean isReady()
      Indicates whether solver is ready to find a solution.
      Returns:
      true if solver is ready, false otherwise.
    • 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.
      Returns:
      quality scores corresponding to each sample.
    • setQualityScores

      public void setQualityScores(double[] qualityScores) throws 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.
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than minimum required samples.
      LockedException - if robust solver is locked because an estimation is already in progress.
    • getCovariance

      public com.irurueta.algebra.Matrix getCovariance()
      Gets estimated covariance of estimated position if available. This is only available when result has been refined and covariance is kept.
      Returns:
      estimated covariance or null.
    • setPositionsAndDistances

      public void setPositionsAndDistances(P[] positions, double[] distances) throws LockedException
      Sets known positions and Euclidean distances. If any distance value is zero or negative, it will be fixed assuming an EPSILON value.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (2 points).
      LockedException - if instance is busy solving the lateration problem.
    • setPositionsDistancesAndStandardDeviations

      public void setPositionsDistancesAndStandardDeviations(P[] positions, double[] distances, double[] distanceStandardDeviations) throws LockedException
      Sets known positions, Euclidean distances and the respective standard deviations of measured distances. If any distance value is zero or negative, it will be fixed assuming an EPSILON value.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if either positions, distances or standard deviations are null, don't have the same length of their length is smaller than required (2 points).
      LockedException - if instance is busy solving the lateration problem.
    • getEstimatedPosition

      public P getEstimatedPosition()
      Gets estimated position.
      Returns:
      estimated position.
    • getNumberOfDimensions

      public abstract int getNumberOfDimensions()
      Gets number of dimensions of provided points.
      Returns:
      number of dimensions of provided points.
    • getMinRequiredPositionsAndDistances

      public abstract int getMinRequiredPositionsAndDistances()
      Minimum required number of positions and distances. This value will depend on actual implementation and whether we are solving a 2D or 3D problem.
      Returns:
      minimum required number of positions and distances.
    • getPreliminarySubsetSize

      public int getPreliminarySubsetSize()
      Gets size of subsets to be checked during robust estimation. This has to be at least getMinRequiredPositionsAndDistances().
      Returns:
      size of subsets to be checked during robust estimation.
    • setPreliminarySubsetSize

      public void setPreliminarySubsetSize(int preliminarySubsetSize) throws LockedException
      Sets size of subsets to be checked during robust estimation. This has to be at least getMinRequiredPositionsAndDistances().
      Parameters:
      preliminarySubsetSize - size of subsets to be checked during robust estimation.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
      IllegalArgumentException - if provided value is less than getMinRequiredPositionsAndDistances().
    • solve

      public abstract P solve() throws LockedException, NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Solves the lateration problem.
      Returns:
      estimated position.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
      NotReadyException - if solver is not ready.
      com.irurueta.numerical.robust.RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getMethod

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

      protected void internalSetPositionsAndDistances(P[] positions, double[] distances)
      Internally sets known positions and Euclidean distances. If any distance value is zero or negative, it will be fixed assuming an EPSILON value.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (2 points).
    • internalSetPositionsDistancesAndStandardDeviations

      protected void internalSetPositionsDistancesAndStandardDeviations(P[] positions, double[] distances, double[] distanceStandardDeviations)
      Internally sets known positions, Euclidean distances and the respective standard deviations of measured distances. If any distance value is zero or negative, it will be fixed assuming an EPSILON value.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (2 points).