public interface Optimizer
Modifier and Type | Interface and Description |
---|---|
static class |
Optimizer.OptimizerException
Exception for when there is a problem with an optimiser.
|
Modifier and Type | Method and Description |
---|---|
<R extends Likelihood> |
maximise(Optimizable<R> l,
Parameters p)
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
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
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
|
<R extends Likelihood> R maximise(Optimizable<R> l, Parameters p) throws GeneralException
R
- The type returned by the calculatorl
- The likelihood calculatorp
- The parameters to maximise. Parameters are modified.GeneralException
- When there is a problem in finding an optimisable solution.<R extends Likelihood> R maximise(Optimizable<R> l, Parameters params, java.io.File log) throws GeneralException
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 solution<R extends Likelihood> R restart(Optimizable<R> l, java.io.File checkPoint) throws GeneralException
setCheckPointFile(java.io.File)
,
logging to the screen. Logging level should be set in the constructor of implementing classes.R
- The type returned by the calculatorl
- The likelihood calculatorcheckPoint
- The checkpoint fileGeneralException
- When there is a problem in finding an optimisable solution<R extends Likelihood> R restart(Optimizable<R> l, java.io.File checkPoint, java.io.File log) throws GeneralException
setCheckPointFile(java.io.File)
,
logging to a file. Logging level should be set in the constructor of implementing classes.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 solutionvoid setCheckPointFile(java.io.File checkPoint) throws Optimizer.OptimizerException
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.checkPoint
- The chekpoint file.Optimizer.OptimizerException
- Thrown if the optomiser
does not implement checkpoints.void setCheckPointFrequency(int num, java.util.concurrent.TimeUnit unit) throws Optimizer.OptimizerException
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.void setMaximumRunTime(int num, java.util.concurrent.TimeUnit unit) throws Optimizer.OptimizerException
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.