public class RootBracketExpander extends AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,LineBracket> implements RootBracketer
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_INITIAL_GUESS
Default initial guess, 0.0
|
static int |
DEFAULT_MAX_ITERATIONS
Default max iterations, 100
|
static double |
SCALE_FACTOR
Default scale factor on expansion, the golden ratio, 1.618034
|
data, keepGoing
maxIterations
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
RootBracketExpander()
Creates a new instance of RootBracketExpander
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupAlgorithm()
Called to clean up the learning algorithm's state after learning has
finished.
|
LineBracket |
getBracket()
Getter for bracket.
|
double |
getInitialGuess()
Getter for initialGuess.
|
LineBracket |
getResult()
Gets the current result of the algorithm.
|
protected boolean |
initializeAlgorithm()
Called to initialize the learning algorithm's state based on the
data that is stored in the data field.
|
boolean |
isResultValid()
Indicates whether or not the algorithm results are in a consistent state
or not.
|
protected void |
setBracket(LineBracket bracket)
Setter for bracket.
|
void |
setInitialGuess(double initialGuess)
Sets the initial guess of the root location.
|
protected boolean |
step()
Called to take a single step of the learning algorithm.
|
clone, getData, getKeepGoing, learn, setData, setKeepGoing, stop
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
clone
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
stop
public static final double SCALE_FACTOR
public static final int DEFAULT_MAX_ITERATIONS
public static final double DEFAULT_INITIAL_GUESS
public RootBracketExpander()
protected boolean initializeAlgorithm()
AbstractAnytimeBatchLearner
initializeAlgorithm
in class AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,LineBracket>
protected boolean step()
AbstractAnytimeBatchLearner
step
in class AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,LineBracket>
protected void cleanupAlgorithm()
AbstractAnytimeBatchLearner
cleanupAlgorithm
in class AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,LineBracket>
public LineBracket getResult()
AnytimeAlgorithm
getResult
in interface AnytimeAlgorithm<LineBracket>
public boolean isResultValid()
StoppableAlgorithm
StoppableAlgorithm
may not always be able to stop in a
manner that makes its results valid. This method is used to check whether
the results are in a consistent state or not.isResultValid
in interface StoppableAlgorithm
isResultValid
in class AbstractAnytimeAlgorithm<LineBracket>
public double getInitialGuess()
public void setInitialGuess(double initialGuess)
RootBracketer
setInitialGuess
in interface RootBracketer
initialGuess
- Initial guess of the root location.public LineBracket getBracket()
protected void setBracket(LineBracket bracket)
bracket
- Bracket on the root location.