java.lang.Object
Localiser.algorithms.genericLocaliser.leastSquares.LeastSquares
All Implemented Interfaces:
MinimisationAlgorithm

public class LeastSquares extends Object implements MinimisationAlgorithm
A least squares algorithm for solving particular localisation problems. Less generic than MCMC and Simplex.
Author:
Jamie Macaulay
  • Constructor Details

    • LeastSquares

      public LeastSquares()
  • Method Details

    • setMinimisationFunction

      public void setMinimisationFunction(MinimisationFunction leastSquaresData)
      Set the least squares algorithm.
      Specified by:
      setMinimisationFunction in interface MinimisationAlgorithm
      Parameters:
      leastSquaresData - - the minimisation function specific to the problem whihc needs solved
    • localiseDetectionGroup

      public boolean localiseDetectionGroup(Chi2Bearings bearingInfo)
      Calcuates the position of a detection assuming that sub detections all contain bearings, which are probably ambiguous. If groupSize > 0, then atempt to group clicks into fewer categories to speed up fit. (Not implemented).
      Parameters:
      bearingInfo -
      side - -1 or 1 for left and right
      groupSize -
      Returns:
      true of localisation calculated successfully
    • runAlgorithm

      public boolean runAlgorithm()
      Description copied from interface: MinimisationAlgorithm
      Run the algorithm to find a solution to the set minimisation function. This
      Specified by:
      runAlgorithm in interface MinimisationAlgorithm
      Returns:
      true if the algorithm competed sucessfully.
    • getResult

      public double[][] getResult()
      Description copied from interface: MinimisationAlgorithm
      Get the result. There maybe multiple results if ambiguities exist. The number of dimensions is defined in the minimisation function.
      Specified by:
      getResult in interface MinimisationAlgorithm
      Returns:
      the result
    • getChi2

      public double[] getChi2()
      Description copied from interface: MinimisationAlgorithm
      The chi2 value for each result
      Specified by:
      getChi2 in interface MinimisationAlgorithm
      Returns:
      the chi2 value for each result.
    • getErrors

      public LocaliserError[] getErrors()
      Description copied from interface: MinimisationAlgorithm
      Get the errors. Should be the same number of dimensions as the result. If errors have not been calculated leave as null The number of dimensions is defined in the minimisation function.
      Specified by:
      getErrors in interface MinimisationAlgorithm
      Returns:
      the errors in the result
    • notifyStatus

      public void notifyStatus(int status, double progress)
      Description copied from interface: MinimisationAlgorithm
      A progress function which can be used to update different threads.
      Specified by:
      notifyStatus in interface MinimisationAlgorithm
      Parameters:
      status - - the current status flag.
      progress - - the progress of the algorithm from 0 to 1.0.
    • hasParams

      public boolean hasParams()
      Description copied from interface: MinimisationAlgorithm
      A progress function which can be used to update different threads.
      Specified by:
      hasParams in interface MinimisationAlgorithm
    • getSettingsPane

      public LocaliserPane<?> getSettingsPane()
      Description copied from interface: MinimisationAlgorithm
      A settings pane for the algorithm if it has user changeable parameters.
      Specified by:
      getSettingsPane in interface MinimisationAlgorithm
      Returns:
      a settings pane.