java.lang.Object
com.irurueta.navigation.inertial.calibration.intervals.thresholdfactor.IntervalDetectorThresholdFactorOptimizer<T,S>
Type Parameters:
T - type of data to be used as input for this optimizer.
S - type of data source for this optimizer.
Direct Known Subclasses:
AccelerometerAndGyroscopeIntervalDetectorThresholdFactorOptimizer, AccelerometerGyroscopeAndMagnetometerIntervalDetectorThresholdFactorOptimizer, AccelerometerIntervalDetectorThresholdFactorOptimizer, GyroscopeIntervalDetectorThresholdFactorOptimizer, MagnetometerIntervalDetectorThresholdFactorOptimizer

public abstract class IntervalDetectorThresholdFactorOptimizer<T,S extends IntervalDetectorThresholdFactorOptimizerDataSource<T>> extends Object
Optimizes the threshold factor for interval detection of accelerometer data based on results of accelerometers, gyroscopes or magnetometers calibration.
  • Field Details

    • DEFAULT_PROGRESS_DELTA

      public static final float DEFAULT_PROGRESS_DELTA
      Default amount of progress variation before notifying a change in optimization 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:
    • dataSource

      Retrieves data for this optimizer.
    • running

      protected boolean running
      Indicates whether this optimizer is running or not.
    • minMse

      protected double minMse
      Minimum Mean Square Error that has been found.
    • optimalThresholdFactor

      protected double optimalThresholdFactor
      Optimal threshold factor that has been found.
    • listener

      Listener that notifies events generated by this optimizer.
    • progressDelta

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

      protected float progress
      Current progress of optimization.
    • previousProgress

      protected float previousProgress
      Previously notified progress of optimization.
  • Constructor Details

    • IntervalDetectorThresholdFactorOptimizer

      protected IntervalDetectorThresholdFactorOptimizer()
      Constructor.
    • IntervalDetectorThresholdFactorOptimizer

      protected IntervalDetectorThresholdFactorOptimizer(S dataSource)
      Constructor.
      Parameters:
      dataSource - instance in charge of retrieving data for this optimizer.
  • Method Details

    • getDataSource

      public S getDataSource()
      Gets instance in charge of retrieving data for this optimizer.
      Returns:
      instance in charge of retrieving data for this optimizer.
    • setDataSource

      public void setDataSource(S dataSource) throws com.irurueta.navigation.LockedException
      Sets an instance in charge of retrieving data for this optimizer.
      Parameters:
      dataSource - instance in charge of retrieving data for this optimizer.
      Throws:
      com.irurueta.navigation.LockedException - if optimizer is already running.
    • getListener

      Gets a listener that notifies events generated by this optimizer.
      Returns:
      listener that notifies events generated by this optimizer.
    • setListener

      public void setListener(IntervalDetectorThresholdFactorOptimizerListener<T,S> listener) throws com.irurueta.navigation.LockedException
      Sets a listener that notifies events generated by this optimizer.
      Parameters:
      listener - listener that notifies events generated by this optimizer.
      Throws:
      com.irurueta.navigation.LockedException - if optimizer is already running.
    • getProgressDelta

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

      public void setProgressDelta(float progressDelta) throws com.irurueta.navigation.LockedException
      Sets the amount of progress variation before notifying a progress change during optimization.
      Parameters:
      progressDelta - amount of progress variation before notifying a progress change during optimization.
      Throws:
      IllegalArgumentException - if the progress delta is less than zero or greater than 1.
      com.irurueta.navigation.LockedException - if optimizer is currently running.
    • isRunning

      public boolean isRunning()
      Indicates whether this optimizer is busy optimizing a threshold factor.
      Returns:
      true if optimizer is busy, false otherwise.
    • isReady

      public boolean isReady()
      Indicates whether this optimizer is ready to start optimization.
      Returns:
      true if this optimizer is ready, false otherwise.
    • getMinMse

      public double getMinMse()
      Gets minimum Mean Square Error that has been found for calibration.
      Returns:
      minimum Mean Square Error that has been found.
    • getOptimalThresholdFactor

      public double getOptimalThresholdFactor()
      Gets the optimal threshold factor that has been found.
      Returns:
      optimal threshold factor that has been found.
    • optimize

      public abstract double optimize() throws com.irurueta.navigation.NotReadyException, com.irurueta.navigation.LockedException, IntervalDetectorThresholdFactorOptimizerException
      Optimizes the threshold factor for a static interval detector or measurement generator to minimize MSE (Minimum Squared Error) of estimated calibration parameters.
      Returns:
      optimized threshold factor.
      Throws:
      com.irurueta.navigation.NotReadyException - if this optimizer is not ready to start optimization.
      com.irurueta.navigation.LockedException - if optimizer is already running.
      IntervalDetectorThresholdFactorOptimizerException - if optimization fails for some reason.
    • checkAndNotifyProgress

      protected void checkAndNotifyProgress()
      Checks current progress and notifies if progress has changed significantly.
    • initProgress

      protected void initProgress()
      Initializes progress values.