Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.algorithms.optimization.termination
Class SmallDifferenceOfFunctionEvaluationsCondition

    java.lang.Object
      de.jstacs.algorithms.optimization.termination.AbstractTerminationCondition
          de.jstacs.algorithms.optimization.termination.SmallDifferenceOfFunctionEvaluationsCondition

All Implemented Interfaces:
  TerminationCondition, InstantiableFromParameterSet, Storable, Cloneable

    public class SmallDifferenceOfFunctionEvaluationsCondition

extends AbstractTerminationCondition

This class implements a `TerminationCondition` that stops an optimization if the difference of the current and the last function evaluations will be small, i.e., .

Author:
  Jens Keilwagen

Nested Class Summary
`static class` | `SmallDifferenceOfFunctionEvaluationsCondition.SmallDifferenceOfFunctionEvaluationsConditionParameterSet` This class implements the parameter set for a `SmallDifferenceOfFunctionEvaluationsCondition`.

Nested classes/interfaces inherited from class de.jstacs.algorithms.optimization.termination.AbstractTerminationCondition
`AbstractTerminationCondition.AbstractTerminationConditionParameterSet`

Field Summary

Fields inherited from class de.jstacs.algorithms.optimization.termination.AbstractTerminationCondition
`parameter`

Constructor Summary
`SmallDifferenceOfFunctionEvaluationsCondition(double epsilon)` This constructor creates an instance that stops the optimization if the difference of the current and the last function evaluations is smaller than `epsilon`.
`SmallDifferenceOfFunctionEvaluationsCondition(SmallDifferenceOfFunctionEvaluationsCondition.SmallDifferenceOfFunctionEvaluationsConditionParameterSet parameter)` This is the main constructor creating an instance from a given parameter set.
`SmallDifferenceOfFunctionEvaluationsCondition(StringBuffer xml)` The standard constructor for the interface `Storable`.

Method Summary
`boolean` | `doNextIteration(int iteration, double f_last, double f_current, double[] gradient, double[] direction, double alpha, Time t)` This method allows to decide whether to do another iteration in an optimization or not.
`protected String` | `getXmlTag()` This method returns the xml tag that is used in the method `AbstractTerminationCondition.toXML()` and in the constructor `AbstractTerminationCondition.AbstractTerminationCondition(StringBuffer)`.
`boolean` | `isSimple()` This method returns `false` if the `TerminationCondition` uses either the gradient or the direction for the decision, otherwise it returns `true`.
`protected void` | `set()` This method sets internal member variables from `AbstractTerminationCondition.parameter`.

Methods inherited from class de.jstacs.algorithms.optimization.termination.AbstractTerminationCondition
`clone, getCurrentParameterSet, toXML`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SmallDifferenceOfFunctionEvaluationsCondition

    public SmallDifferenceOfFunctionEvaluationsCondition(double epsilon)
                                                  throws Exception

  This constructor creates an instance that stops the optimization if the difference of the current and the last function evaluations is smaller than `epsilon`.

  Parameters:
    `epsilon` - the threshold for stopping, has to be non-negative
  Throws:
    `Exception` - if the parameter can not be set properly

### SmallDifferenceOfFunctionEvaluationsCondition

    public SmallDifferenceOfFunctionEvaluationsCondition(SmallDifferenceOfFunctionEvaluationsCondition.SmallDifferenceOfFunctionEvaluationsConditionParameterSet parameter)
                                                  throws CloneNotSupportedException

  This is the main constructor creating an instance from a given parameter set.

  Parameters:
    `parameter` - the set of parameters
  Throws:
    `CloneNotSupportedException` - if `parameter` can not be cloned properly.

### SmallDifferenceOfFunctionEvaluationsCondition

    public SmallDifferenceOfFunctionEvaluationsCondition(StringBuffer xml)
                                                  throws NonParsableException

  The standard constructor for the interface `Storable`. Constructs a `SmallDifferenceOfFunctionEvaluationsCondition` out of an XML representation.

  Parameters:
    `xml` - the XML representation as `StringBuffer`
  Throws:
    `NonParsableException` - if the `SmallDifferenceOfFunctionEvaluationsCondition` could not be reconstructed out of the `StringBuffer` `xml`

Method Detail

### set

    protected void set()

  Description copied from class: `AbstractTerminationCondition`
  This method sets internal member variables from `AbstractTerminationCondition.parameter`. It is used in the constructors.

  Specified by:
    `set` in class `AbstractTerminationCondition`

### getXmlTag

    protected String getXmlTag()

  Description copied from class: `AbstractTerminationCondition`
  This method returns the xml tag that is used in the method `AbstractTerminationCondition.toXML()` and in the constructor `AbstractTerminationCondition.AbstractTerminationCondition(StringBuffer)`.

  Specified by:
    `getXmlTag` in class `AbstractTerminationCondition`
  Returns:
    the xml tag of the instance

### doNextIteration

    public boolean doNextIteration(int iteration,
                                   double f_last,
                                   double f_current,
                                   double[] gradient,
                                   double[] direction,
                                   double alpha,
                                   Time t)

  Description copied from interface: `TerminationCondition`
  This method allows to decide whether to do another iteration in an optimization or not. If it returns `true` it is recommended to do another iteration, otherwise (the method returns `false` and) it is recommended to stop the algorithm.

  Parameters:
    `iteration` - the number of performed iterations
    `f_last` - last value of the function
    `f_current` - current value of the function
    `gradient` - the gradient of the function
    `direction` - the last direction of the optimization
    `alpha` - the last step size
    `t` - a time object measuring the time that has been elapsed in the optimization
  Returns:
    `true` if another iteration should be done

### isSimple

    public boolean isSimple()

  Description copied from interface: `TerminationCondition`
  This method returns `false` if the `TerminationCondition` uses either the gradient or the direction for the decision, otherwise it returns `true`.

  Returns:
    `false` for gradient or direction based `TerminationCondition`s

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD