Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.termination
Class UserAbort

java.lang.Object
  extended by org.uncommons.watchmaker.framework.termination.UserAbort
All Implemented Interfaces:
TerminationCondition

public final class UserAbort
extends Object
implements TerminationCondition

TerminationCondition implementation that allows for user-initiated termination of an evolutionary algorithm. This condition can be used, for instance, to provide a button on a GUI that terminates execution. The application should retain a reference to the instance after passing it to the evolution engine and should invoke the abort() method to make the evolution terminate at the end of the current generation.

Author:
Daniel Dyer
See Also:
AbortControl

Constructor Summary
UserAbort()
           
 
Method Summary
 void abort()
          Aborts any evolutionary algorithms that monitor this termination condition instance.
 boolean isAborted()
           
 void reset()
          Resets the abort condition to false so that it may be reused.
 boolean shouldTerminate(PopulationData<?> populationData)
          The condition is queried via this method to determine whether or not evolution should finish at the current point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAbort

public UserAbort()
Method Detail

shouldTerminate

public boolean shouldTerminate(PopulationData<?> populationData)
The condition is queried via this method to determine whether or not evolution should finish at the current point.

Specified by:
shouldTerminate in interface TerminationCondition
Parameters:
populationData - Information about the current state of evolution. This may be used to determine whether evolution should continue or not.
Returns:
true if evolution should be terminated, false otherwise.

abort

public void abort()
Aborts any evolutionary algorithms that monitor this termination condition instance.


isAborted

public boolean isAborted()
Returns:
true if the abort() method has been invoked, false otherwise.

reset

public void reset()
Resets the abort condition to false so that it may be reused.


Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)