|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.algorithms.optimization.termination.AbstractTerminationCondition
de.jstacs.algorithms.optimization.termination.IterationCondition
public class IterationCondition
This class will stop an optimization if the number of iteration reaches a given number.
Nested Class Summary | |
---|---|
static class |
IterationCondition.IterationConditionParameterSet
This class implements the parameter set for a IterationCondition . |
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 | |
---|---|
IterationCondition(int maxIter)
This constructor creates an instance that does not allow any further iteration after maxIter iterations. |
|
IterationCondition(IterationCondition.IterationConditionParameterSet parameter)
This is the main constructor creating an instance from a given parameter set. |
|
IterationCondition(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 |
---|
public IterationCondition(int maxIter) throws Exception
maxIter
iterations.
maxIter
- the maximal number of iterations
Exception
- if the parameter can not be set properlypublic IterationCondition(IterationCondition.IterationConditionParameterSet parameter) throws CloneNotSupportedException
parameter
- the set of parameters
CloneNotSupportedException
- if parameter
can not be cloned properly.public IterationCondition(StringBuffer xml) throws NonParsableException
Storable
.
Constructs a IterationCondition
out of an XML representation.
xml
- the XML representation as StringBuffer
NonParsableException
- if the IterationCondition
could not be reconstructed out of
the StringBuffer
xml
Method Detail |
---|
protected void set()
AbstractTerminationCondition
AbstractTerminationCondition.parameter
.
It is used in the constructors.
set
in class AbstractTerminationCondition
protected String getXmlTag()
AbstractTerminationCondition
AbstractTerminationCondition.toXML()
and
in the constructor AbstractTerminationCondition.AbstractTerminationCondition(StringBuffer)
.
getXmlTag
in class AbstractTerminationCondition
public boolean doNextIteration(int iteration, double f_last, double f_current, double[] gradient, double[] direction, double alpha, Time t)
TerminationCondition
true
it is recommended to do another iteration, otherwise
(the method returns false
and) it is recommended to stop the algorithm.
iteration
- the number of performed iterationsf_last
- last value of the functionf_current
- current value of the functiongradient
- the gradient of the functiondirection
- the last direction of the optimizationalpha
- the last step sizet
- a time object measuring the time that has been elapsed in the optimization
true
if another iteration should be donepublic boolean isSimple()
TerminationCondition
false
if the TerminationCondition
uses either
the gradient or the direction for the decision, otherwise it returns true
.
false
for gradient or direction based TerminationCondition
s
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |