|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.stoppingcondition.OptimiserStalled
public class OptimiserStalled
used to check if optimisation algorithm has stalled. still a very crude implementation. if the distance from the current best is less then the specified minimum for more then the specified maximum consecutive minimum change, then the algorithm is assumed to have stalled.
Field Summary | |
---|---|
protected int |
maxConsecutiveMinChange
|
protected double |
minChange
|
protected int |
minChangeCounter
|
Fields inherited from interface net.sourceforge.cilib.stoppingcondition.StoppingCondition |
---|
CICLOPS_EXCLUDE_ALGORITHM |
Constructor Summary | |
---|---|
OptimiserStalled()
Creates a new instance of OptimiserStalled. |
|
OptimiserStalled(OptimiserStalled copy)
Copy constructor. |
Method Summary | |
---|---|
OptimiserStalled |
getClone()
Create a cloned copy of the current object and return it. |
double |
getPercentageCompleted()
Determines the percentage complete for the associated algorithm. |
boolean |
isCompleted()
Determines whether the stopping condition has been satisfied (equivalent to StoppingCondition.getPercentageCompleted() == 1.0 but may be more efficient). |
void |
setAlgorithm(Algorithm algorithm)
Sets the algorithm that this stopping condition should be applied to. |
void |
setMaxConsecutiveMinChange(int count)
sets the maximum consecutive evalutions that an algorithm can improve less then the minimum. |
void |
setMinimumChange(double distance)
sets the minimum percentage that the new best location must be from the previous. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double minChange
protected int maxConsecutiveMinChange
protected int minChangeCounter
Constructor Detail |
---|
public OptimiserStalled()
public OptimiserStalled(OptimiserStalled copy)
copy
- The instance to create the copy from.Method Detail |
---|
public OptimiserStalled getClone()
getClone
in interface StoppingCondition
getClone
in interface Cloneable
Object.clone()
public double getPercentageCompleted()
getPercentageCompleted
in interface StoppingCondition
public boolean isCompleted()
StoppingCondition.getPercentageCompleted()
== 1.0 but may be more efficient).
isCompleted
in interface StoppingCondition
public void setAlgorithm(Algorithm algorithm)
Algorithm.addStoppingCondition(StoppingCondition)
. This ensures that any down casting
necessary is done only once, when the stopping codition is added to an alogorithm (as apposed
to after each iteration).
setAlgorithm
in interface StoppingCondition
algorithm
- The applicable Algorithm
.public void setMinimumChange(double distance)
distance
- The value to set.public void setMaxConsecutiveMinChange(int count)
count
- The value to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |