Modifier and Type | Class and Description |
---|---|
static class |
NelderMead.DebugLevel
Enumeration of the debug level
|
Optimizer.OptimizerException
Constructor and Description |
---|
NelderMead()
Constrcutor that defaults to no debug output
|
NelderMead(NelderMead.DebugLevel debug)
Constructor that allows user defined debug level
|
Modifier and Type | Method and Description |
---|---|
<R extends Likelihood> |
maximise(Optimizable<R> l,
Parameters params)
Maximises the likelihood, logging to screen.
|
<R extends Likelihood> |
maximise(Optimizable<R> l,
Parameters params,
java.io.File log)
Maximises the likelihood, logging to a file.
|
<R extends Likelihood> |
restart(Optimizable<R> l,
java.io.File checkPoint)
Maximises the likelihood starting from a checkpoint file (see
Optimizer.setCheckPointFile(java.io.File) ,
logging to the screen. |
<R extends Likelihood> |
restart(Optimizable<R> l,
java.io.File checkPoint,
java.io.File log)
Maximises the likelihood starting from a checkpoint file (see
Optimizer.setCheckPointFile(java.io.File) ,
logging to a file. |
void |
setCheckPointFile(java.io.File checkPoint)
Sets a checkpoint file.
|
void |
setCheckPointFrequency(int num,
java.util.concurrent.TimeUnit unit)
Sets how often a checkpoint is saved (if a file has been set).
|
void |
setMaximumRunTime(int num,
java.util.concurrent.TimeUnit unit)
Set a maximum time the optimiser should run for
|
public NelderMead()
public NelderMead(NelderMead.DebugLevel debug)
debug
- Debug levelpublic <R extends Likelihood> R maximise(Optimizable<R> l, Parameters params) throws GeneralException
Optimizer
maximise
in interface Optimizer
R
- The type returned by the calculatorl
- The likelihood calculatorparams
- The parameters to maximise. Parameters are modified.GeneralException
- When there is a problem in finding an optimisable solution.public <R extends Likelihood> R maximise(Optimizable<R> l, Parameters params, java.io.File log) throws GeneralException
Optimizer
maximise
in interface Optimizer
R
- The type returned by the calculatorl
- The likelihood calculatorparams
- The parameters to maximise. Parameters are modified.log
- The log fileGeneralException
- When there is a problem in finding an optimisable solutionpublic <R extends Likelihood> R restart(Optimizable<R> l, java.io.File checkPoint) throws GeneralException
Optimizer
Optimizer.setCheckPointFile(java.io.File)
,
logging to the screen. Logging level should be set in the constructor of implementing classes.restart
in interface Optimizer
R
- The type returned by the calculatorl
- The likelihood calculatorcheckPoint
- The checkpoint fileGeneralException
- When there is a problem in finding an optimisable solutionpublic <R extends Likelihood> R restart(Optimizable<R> l, java.io.File checkPoint, java.io.File log) throws GeneralException
Optimizer
Optimizer.setCheckPointFile(java.io.File)
,
logging to a file. Logging level should be set in the constructor of implementing classes.restart
in interface Optimizer
R
- The type returned by the calculatorl
- The likelihood calculatorcheckPoint
- The checkpoint filelog
- The log fileGeneralException
- When there is a problem in finding an optimisable solutionpublic void setCheckPointFile(java.io.File checkPoint) throws Optimizer.OptimizerException
Optimizer
Optimizer.setCheckPointFrequency(int, java.util.concurrent.TimeUnit)
).
This checkpoint file can then be used to restart the optimiser from this
state. Can be useful if optimisation is likely to take a long and the
process could be stopped for some reason.setCheckPointFile
in interface Optimizer
checkPoint
- The chekpoint file.Optimizer.OptimizerException
- Thrown if the optomiser
does not implement checkpoints.public void setCheckPointFrequency(int num, java.util.concurrent.TimeUnit unit) throws Optimizer.OptimizerException
Optimizer
setCheckPointFrequency
in interface Optimizer
num
- The number of time units that should pass between checkpoint
writes.unit
- The time unitOptimizer.OptimizerException
- Thrown if the optomiser
does not implement checkpoints.public void setMaximumRunTime(int num, java.util.concurrent.TimeUnit unit) throws Optimizer.OptimizerException
Optimizer
setMaximumRunTime
in interface Optimizer
num
- The number of time units that should pass between checkpoint
writes.unit
- The time unitOptimizer.OptimizerException
- Thrown if the optimiser
does not implement a maximum run time.