public class CombinedCondition extends AbstractTerminationCondition
TerminationConditions at once.| Modifier and Type | Class and Description |
|---|---|
static class |
CombinedCondition.CombinedConditionParameterSet
This class implements the parameter set for a
CombinedCondition. |
AbstractTerminationCondition.AbstractTerminationConditionParameterSetparameter| Constructor and Description |
|---|
CombinedCondition(CombinedCondition.CombinedConditionParameterSet parameter)
This is the main constructor creating an instance from a given parameter set.
|
CombinedCondition(int threshold,
AbstractTerminationCondition... condition)
This constructor creates an instance that allows to use many
TerminationConditions at once. |
CombinedCondition(StringBuffer xml)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
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. |
clone, getCurrentParameterSet, toXMLpublic CombinedCondition(int threshold,
AbstractTerminationCondition... condition)
throws Exception
TerminationConditions at once.threshold - the number of conditions that has to be fulfilled to continue;
if all conditions should be fulfilled then threshold=condition.length (equal to AND);
if at least one condition should be fulfilled then threshold=1 (equal to OR);condition - the conditions that are used to create this instance and that are used to determine whether another iteration should be doneException - if the parameter can not be set properlypublic CombinedCondition(CombinedCondition.CombinedConditionParameterSet parameter) throws CloneNotSupportedException
parameter - the set of parametersCloneNotSupportedException - if parameter can not be cloned properly.public CombinedCondition(StringBuffer xml) throws NonParsableException
Storable.
Constructs a CombinedCondition out of an XML representation.xml - the XML representation as StringBufferNonParsableException - if the CombinedCondition could not be reconstructed out of
the StringBuffer xmlprotected void set()
AbstractTerminationConditionAbstractTerminationCondition.parameter.
It is used in the constructors.set in class AbstractTerminationConditionprotected String getXmlTag()
AbstractTerminationConditionAbstractTerminationCondition.toXML() and
in the constructor AbstractTerminationCondition.AbstractTerminationCondition(StringBuffer).getXmlTag in class AbstractTerminationConditionpublic boolean doNextIteration(int iteration,
double f_last,
double f_current,
double[] gradient,
double[] direction,
double alpha,
Time t)
TerminationConditiontrue 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 optimizationtrue if another iteration should be donepublic boolean isSimple()
TerminationConditionfalse if the TerminationCondition uses either
the gradient or the direction for the decision, otherwise it returns true.false for gradient or direction based TerminationConditions