Class MultiStageFitness<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.OpenCLFitness<T>
net.bmahe.genetics4j.gpu.spec.fitness.MultiStageFitness<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final FitnessExtractor
<T> static final org.apache.logging.log4j.Logger
private final MultiStageDescriptor
-
Constructor Summary
ConstructorDescriptionMultiStageFitness
(MultiStageDescriptor _multiStageDescriptor, FitnessExtractor<T> _fitnessExtractor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAllEvaluations
(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService) void
afterEvaluation
(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService, long generation, List<Genotype> genotypes) private void
allocateLocalMemory
(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor, long generation, List<Genotype> genotypes, KernelExecutionContext kernelExecutionContext) void
beforeAllEvaluations
(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService) protected void
protected void
clearResultData
(Map<Integer, CLData> resultData) protected void
clearStaticData
(Device device) compute
(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService, long generation, List<Genotype> genotypes) protected void
loadData
(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor, Map<Integer, CLData> data, long generation, List<Genotype> genotypes) static <U extends Comparable<U>>
MultiStageFitness<U> of
(MultiStageDescriptor multiStageDescriptor, FitnessExtractor<U> fitnessExtractor) protected void
prepareStaticData
(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor) Methods inherited from class net.bmahe.genetics4j.gpu.spec.fitness.OpenCLFitness
afterAllEvaluations, afterEvaluation, beforeAllEvaluations, beforeEvaluation, beforeEvaluation
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
multiStageDescriptor
-
fitnessExtractor
-
staticData
-
-
Constructor Details
-
MultiStageFitness
public MultiStageFitness(MultiStageDescriptor _multiStageDescriptor, FitnessExtractor<T> _fitnessExtractor)
-
-
Method Details
-
clearStaticData
-
clearData
-
clearResultData
-
prepareStaticData
protected void prepareStaticData(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor) -
allocateLocalMemory
private void allocateLocalMemory(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor, long generation, List<Genotype> genotypes, KernelExecutionContext kernelExecutionContext) -
loadData
protected void loadData(OpenCLExecutionContext openCLExecutionContext, StageDescriptor stageDescriptor, Map<Integer, CLData> data, long generation, List<Genotype> genotypes) -
beforeAllEvaluations
public void beforeAllEvaluations(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService) - Overrides:
beforeAllEvaluations
in classOpenCLFitness<T extends Comparable<T>>
-
compute
public CompletableFuture<List<T>> compute(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService, long generation, List<Genotype> genotypes) - Specified by:
compute
in classOpenCLFitness<T extends Comparable<T>>
-
afterEvaluation
public void afterEvaluation(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService, long generation, List<Genotype> genotypes) - Overrides:
afterEvaluation
in classOpenCLFitness<T extends Comparable<T>>
-
afterAllEvaluations
public void afterAllEvaluations(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService) - Overrides:
afterAllEvaluations
in classOpenCLFitness<T extends Comparable<T>>
-
of
public static <U extends Comparable<U>> MultiStageFitness<U> of(MultiStageDescriptor multiStageDescriptor, FitnessExtractor<U> fitnessExtractor)
-