gov.sandia.cognition.learning.algorithm.root
Class MinimizerBasedRootFinder

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
          extended by gov.sandia.cognition.algorithm.AnytimeAlgorithmWrapper<InputOutputPair<Double,Double>,LineMinimizer<Evaluator<Double,Double>>>
              extended by gov.sandia.cognition.learning.algorithm.root.MinimizerBasedRootFinder
All Implemented Interfaces:
AnytimeAlgorithm<InputOutputPair<Double,Double>>, IterativeAlgorithm, IterativeAlgorithmListener, StoppableAlgorithm, BatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>, RootFinder, CloneableSerializable, Serializable, Cloneable

public class MinimizerBasedRootFinder
extends AnytimeAlgorithmWrapper<InputOutputPair<Double,Double>,LineMinimizer<Evaluator<Double,Double>>>
implements RootFinder

A root finder that uses minimization techniques to find the roots (zero-crossings).

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
DEFAULT_ITERATION, iteration
 
Constructor Summary
MinimizerBasedRootFinder()
          Creates a new instance of MinimizerBasedRootFinder
MinimizerBasedRootFinder(LineMinimizer<Evaluator<Double,Double>> algorithm)
          Creates a new instance of MinimizerBasedRootFinder
 
Method Summary
 double getInitialGuess()
          Sets the initial guess of the root (zero-crossing), which is supplied as input to the function to find the zero-crossings of.
 InputOutputPair<Double,Double> getResult()
          Gets the current result of the algorithm.
 double getTolerance()
          Gets the tolerance of the algorithm.
 InputOutputPair<Double,Double> learn(Evaluator<Double,Double> data)
          The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.
 void setInitialGuess(double intitialGuess)
          Sets the initial guess of the root (zero-crossing), which is supplied as input to the function to find the zero-crossings of.
 void setTolerance(double tolerance)
          Sets the tolerance of the algorithm.
 
Methods inherited from class gov.sandia.cognition.algorithm.AnytimeAlgorithmWrapper
algorithmEnded, algorithmStarted, clone, getAlgorithm, getIteration, getMaxIterations, isResultValid, readResolve, setAlgorithm, setMaxIterations, stepEnded, stepStarted, stop
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.algorithm.AnytimeAlgorithm
getMaxIterations, setMaxIterations
 
Methods inherited from interface gov.sandia.cognition.algorithm.IterativeAlgorithm
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
 
Methods inherited from interface gov.sandia.cognition.algorithm.StoppableAlgorithm
isResultValid, stop
 

Constructor Detail

MinimizerBasedRootFinder

public MinimizerBasedRootFinder()
Creates a new instance of MinimizerBasedRootFinder


MinimizerBasedRootFinder

public MinimizerBasedRootFinder(LineMinimizer<Evaluator<Double,Double>> algorithm)
Creates a new instance of MinimizerBasedRootFinder

Parameters:
algorithm - Minimization algorithm.
Method Detail

getResult

public InputOutputPair<Double,Double> getResult()
Description copied from interface: AnytimeAlgorithm
Gets the current result of the algorithm.

Specified by:
getResult in interface AnytimeAlgorithm<InputOutputPair<Double,Double>>
Returns:
Current result of the algorithm.

getInitialGuess

public double getInitialGuess()
Description copied from interface: RootFinder
Sets the initial guess of the root (zero-crossing), which is supplied as input to the function to find the zero-crossings of.

Specified by:
getInitialGuess in interface RootFinder
Returns:
Initial guess of the root location.

setInitialGuess

public void setInitialGuess(double intitialGuess)
Description copied from interface: RootFinder
Sets the initial guess of the root (zero-crossing), which is supplied as input to the function to find the zero-crossings of.

Specified by:
setInitialGuess in interface RootFinder
Parameters:
intitialGuess - Initial guess of the root location.

setTolerance

public void setTolerance(double tolerance)
Description copied from interface: RootFinder
Sets the tolerance of the algorithm. Smaller tolerances may yield more accurate estimates but spend more computation finding them.

Specified by:
setTolerance in interface RootFinder
Parameters:
tolerance - Tolerance, where tolerances closer to zero are more accurate, and larger tolerances are less accurate. In any case, tolerance must be greater than or equal to zero.

getTolerance

public double getTolerance()
Description copied from interface: RootFinder
Gets the tolerance of the algorithm.

Specified by:
getTolerance in interface RootFinder
Returns:
Tolerance, where tolerances closer to zero are more accurate, and larger tolerances are less accurate. In any case, tolerance must be greater than or equal to zero.

learn

public InputOutputPair<Double,Double> learn(Evaluator<Double,Double> data)
Description copied from interface: BatchLearner
The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.

Specified by:
learn in interface BatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>
Parameters:
data - The data that the learning algorithm will use to create an object of ResultType.
Returns:
The object that is created based on the given data using the learning algorithm.