Class LeastSquares
java.lang.Object
Localiser.algorithms.genericLocaliser.leastSquares.LeastSquares
- All Implemented Interfaces:
 MinimisationAlgorithm
A least squares algorithm for solving particular localisation problems. Less generic than MCMC and Simplex.
- Author:
 - Jamie Macaulay
 
- 
Field Summary
Fields inherited from interface Localiser.algorithms.genericLocaliser.MinimisationAlgorithm
ALGORITHM_FINISHED, ALGORITHM_FINISHED_ERR, ALGORITHM_RUNNING, PREPARING_ALGORTIHM - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptiondouble[]getChi2()The chi2 value for each resultGet the errors.double[][]Get the result.A settings pane for the algorithm if it has user changeable parameters.booleanA progress function which can be used to update different threads.booleanlocaliseDetectionGroup(Chi2Bearings bearingInfo) Calcuates the position of a detection assuming that sub detections all contain bearings, which are probably ambiguous.voidnotifyStatus(int status, double progress) A progress function which can be used to update different threads.booleanRun the algorithm to find a solution to the set minimisation function.voidsetMinimisationFunction(MinimisationFunction leastSquaresData) Set the least squares algorithm. 
- 
Constructor Details
- 
LeastSquares
public LeastSquares() 
 - 
 - 
Method Details
- 
setMinimisationFunction
Set the least squares algorithm.- Specified by:
 setMinimisationFunctionin interfaceMinimisationAlgorithm- Parameters:
 leastSquaresData- - the minimisation function specific to the problem whihc needs solved
 - 
localiseDetectionGroup
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 rightgroupSize-- Returns:
 - true of localisation calculated successfully
 
 - 
runAlgorithm
public boolean runAlgorithm()Description copied from interface:MinimisationAlgorithmRun the algorithm to find a solution to the set minimisation function. This- Specified by:
 runAlgorithmin interfaceMinimisationAlgorithm- Returns:
 - true if the algorithm competed sucessfully.
 
 - 
getResult
public double[][] getResult()Description copied from interface:MinimisationAlgorithmGet the result. There maybe multiple results if ambiguities exist. The number of dimensions is defined in the minimisation function.- Specified by:
 getResultin interfaceMinimisationAlgorithm- Returns:
 - the result
 
 - 
getChi2
public double[] getChi2()Description copied from interface:MinimisationAlgorithmThe chi2 value for each result- Specified by:
 getChi2in interfaceMinimisationAlgorithm- Returns:
 - the chi2 value for each result.
 
 - 
getErrors
Description copied from interface:MinimisationAlgorithmGet 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:
 getErrorsin interfaceMinimisationAlgorithm- Returns:
 - the errors in the result
 
 - 
notifyStatus
public void notifyStatus(int status, double progress) Description copied from interface:MinimisationAlgorithmA progress function which can be used to update different threads.- Specified by:
 notifyStatusin interfaceMinimisationAlgorithm- 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:MinimisationAlgorithmA progress function which can be used to update different threads.- Specified by:
 hasParamsin interfaceMinimisationAlgorithm
 - 
getSettingsPane
Description copied from interface:MinimisationAlgorithmA settings pane for the algorithm if it has user changeable parameters.- Specified by:
 getSettingsPanein interfaceMinimisationAlgorithm- Returns:
 - a settings pane.
 
 
 -