Interface MinimisationAlgorithm
- All Known Implementing Classes:
LeastSquares
,MCMC
,Simplex
public interface MinimisationAlgorithm
Minimisation algorithm. Designed to be used with MinimisationFunction;
- Author:
- Jamie Macaulay
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The algorithm has finished and a result is presentstatic final int
The algorithm has finished but no result is presentstatic final int
The algorithm is runningstatic final int
Preparing the algorithm -
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.boolean
A progress function which can be used to update different threads.void
notifyStatus
(int status, double progress) A progress function which can be used to update different threads.boolean
Run the algorithm to find a solution to the set minimisation function.void
Set the minimisation function.
-
Field Details
-
PREPARING_ALGORTIHM
static final int PREPARING_ALGORTIHMPreparing the algorithm- See Also:
-
ALGORITHM_RUNNING
static final int ALGORITHM_RUNNINGThe algorithm is running- See Also:
-
ALGORITHM_FINISHED
static final int ALGORITHM_FINISHEDThe algorithm has finished and a result is present- See Also:
-
ALGORITHM_FINISHED_ERR
static final int ALGORITHM_FINISHED_ERRThe algorithm has finished but no result is present- See Also:
-
-
Method Details
-
setMinimisationFunction
Set the minimisation function. This sets up the problem for the algorithm to solve.- Parameters:
minFunc
- - the minimisation function specific to the problem whihc needs solved
-
runAlgorithm
boolean runAlgorithm()Run the algorithm to find a solution to the set minimisation function. This- Returns:
- true if the algorithm competed sucessfully.
-
getResult
double[][] getResult()Get the result. There maybe multiple results if ambiguities exist. The number of dimensions is defined in the minimisation function.- Returns:
- the result
-
getChi2
double[] getChi2()The chi2 value for each result- Returns:
- the chi2 value for each result.
-
getErrors
LocaliserError[] getErrors()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.- Returns:
- the errors in the result
-
notifyStatus
void notifyStatus(int status, double progress) A progress function which can be used to update different threads.- Parameters:
status
- - the current status flag.progress
- - the progress of the algorithm from 0 to 1.0.
-
hasParams
boolean hasParams()A progress function which can be used to update different threads.- Parameters:
status
- - the current status falg.progress
- - the progress of the algorithm from 0 to 1.0.
-
getSettingsPane
LocaliserPane<?> getSettingsPane()A settings pane for the algorithm if it has user changeable parameters.- Returns:
- a settings pane.
-