Class FitnessEvaluationWorker
- java.lang.Object
-
- org.uncommons.watchmaker.framework.FitnessEvaluationWorker
-
public class FitnessEvaluationWorker extends Object
This is the class that actually runs the fitness evaluation tasks created by aEvolutionEngine
. This responsibility is abstracted away from the evolution engine to permit the possibility of creating multiple instances across several machines, all fed by a single shared work queue, using Terracotta (http://www.terracotta.org) or similar.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
A FitnessWorker cannot be garbage-collected if its thread pool has not been shutdown.static void
main(String[] args)
Entry-point for running this class standalone, as an additional node for fitness evaluations.<T> Future<EvaluatedCandidate<T>>
submit(org.uncommons.watchmaker.framework.FitnessEvalutationTask<T> task)
-
-
-
Method Detail
-
submit
public <T> Future<EvaluatedCandidate<T>> submit(org.uncommons.watchmaker.framework.FitnessEvalutationTask<T> task)
-
main
public static void main(String[] args)
Entry-point for running this class standalone, as an additional node for fitness evaluations. If this method is invoked without using Terracotta (or similar) to share the work queue, the program will do nothing.- Parameters:
args
- Program arguments, should be empty.
-
finalize
protected void finalize() throws Throwable
A FitnessWorker cannot be garbage-collected if its thread pool has not been shutdown. This method, invoked on garabage collection (or maybe not at all), shuts down the thread pool so that the threads can be released.
-
-