Class FitnessEvaluatorSync<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorSync<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
FitnessEvaluator<T>
public class FitnessEvaluatorSync<T extends Comparable<T>>
extends Object
implements FitnessEvaluator<T>
Wrapper around
Fitness
for computing the
fitness of a population
In order to leverage multi-core systems and speed up computations, the
population will be split according to the number of partitions defined in
and processed concurrentlyinvalid reference
net.bmahe.genetics4j.core.EASystemnet.bmahe.genetics4j.core.spec.EAExecutionContext#numberOfPartitions()
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EAConfiguration
<T> private final EAExecutionContext
<T> private final ExecutorService
static final org.apache.logging.log4j.Logger
-
Constructor Summary
ConstructorDescriptionFitnessEvaluatorSync
(EAExecutionContext<T> _eaExecutionContext, EAConfiguration<T> _eaConfigurationSync, ExecutorService _executorService) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.bmahe.genetics4j.core.evaluation.FitnessEvaluator
postEvaluation, preEvaluation
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
eaExecutionContext
-
eaConfigurationSync
-
executorService
-
-
Constructor Details
-
FitnessEvaluatorSync
public FitnessEvaluatorSync(EAExecutionContext<T> _eaExecutionContext, EAConfiguration<T> _eaConfigurationSync, ExecutorService _executorService)
-
-
Method Details
-
evaluate
Description copied from interface:FitnessEvaluator
Compute the fitness for a list of genotypes- Specified by:
evaluate
in interfaceFitnessEvaluator<T extends Comparable<T>>
- Parameters:
population
- Population to evaluate- Returns:
- Their associated fitnesses
-