de.kumpe.hadooptimizer.impl
Class CountingHalter<I>

java.lang.Object
  extended by de.kumpe.hadooptimizer.impl.CountingHalter<I>
Type Parameters:
I - the individuals' type
All Implemented Interfaces:
Halter<I>, Stoppable, Serializable

public final class CountingHalter<I>
extends Object
implements Halter<I>, Stoppable

A Halter which halts after the specified number of cycles.

Author:
Christian Kumpe
See Also:
Serialized Form

Constructor Summary
CountingHalter(int nrOfCycles)
          Creates a new CountingHalter which halts after the specified number of cycles.
 
Method Summary
 int getCurrentCycle()
           
 int getNrOfCycles()
           
 boolean halt(Collection<EvaluationResult<I>> evaluationResults)
          Decides whether to stop or continue the evolution cycle.
 void stop()
          Is called once to tell the Halter the stop the evoltion cycle at the end of the current iteration.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CountingHalter

public CountingHalter(int nrOfCycles)
Creates a new CountingHalter which halts after the specified number of cycles.

Parameters:
nrOfCycles - the number of cycles after which the CountingHalter will halt
Method Detail

halt

public boolean halt(Collection<EvaluationResult<I>> evaluationResults)
Description copied from interface: Halter
Decides whether to stop or continue the evolution cycle.

Specified by:
halt in interface Halter<I>
Parameters:
evaluationResults - the EvaluationResults of the parents for the next generation
Returns:
true to stop the evolution cycle, false to continue

getNrOfCycles

public int getNrOfCycles()

getCurrentCycle

public int getCurrentCycle()

stop

public void stop()
Description copied from interface: Stoppable
Is called once to tell the Halter the stop the evoltion cycle at the end of the current iteration.

Specified by:
stop in interface Stoppable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Christian Kumpe. All Rights Reserved.