Class FitnessEvaluatorBulkAsync<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorBulkAsync<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
FitnessEvaluator<T>
public class FitnessEvaluatorBulkAsync<T extends Comparable<T>>
extends Object
implements FitnessEvaluator<T>
Wrapper around
FitnessBulkAsync
for
computing the fitness of a population-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EAConfigurationBulkAsync
<T> private final ExecutorService
static final org.apache.logging.log4j.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionFitnessEvaluatorBulkAsync
(EAConfigurationBulkAsync<T> _eaConfigurationBulkAsync, 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 -
eaConfigurationBulkAsync
-
executorService
-
-
Constructor Details
-
FitnessEvaluatorBulkAsync
public FitnessEvaluatorBulkAsync(EAConfigurationBulkAsync<T> _eaConfigurationBulkAsync, ExecutorService _executorService)
-
-
Method Details
-
evaluate
Description copied from interface:FitnessEvaluator
Evaluates the fitness of all genotypes in the given population.This is the core method that computes fitness values for an entire population of genotypes. The implementation strategy (synchronous, parallel, asynchronous) is determined by the specific evaluator implementation.
Requirements:
- Return fitness values in the same order as input genotypes
- Return exactly one fitness value per input genotype
- Ensure fitness values are comparable for selection operations
- Handle empty populations gracefully (return empty list)
The generation parameter can be used for:
- Adaptive fitness functions that change over time
- Logging and monitoring evaluation progress
- Implementing generation-specific evaluation strategies
- Debugging and performance analysis
- Specified by:
evaluate
in interfaceFitnessEvaluator<T extends Comparable<T>>
- Parameters:
generation
- the current generation number (0-based)genotypes
- the population of genotypes to evaluate- Returns:
- a list of fitness values corresponding to each genotype
-