Package net.bmahe.genetics4j.gpu
Class GPUFitnessEvaluator<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.gpu.GPUFitnessEvaluator<T>
- All Implemented Interfaces:
FitnessEvaluator<T>
public class GPUFitnessEvaluator<T extends Comparable<T>>
extends Object
implements FitnessEvaluator<T>
-
Field Summary
Modifier and TypeFieldDescription(package private) final List
<org.jocl.cl_command_queue> (package private) final List
<org.jocl.cl_context> (package private) final List
<OpenCLExecutionContext> (package private) final List
<org.jocl.cl_program> private final ExecutorService
private final GPUEAConfiguration
<T> private final GPUEAExecutionContext
<T> static final org.apache.logging.log4j.Logger
-
Constructor Summary
ConstructorDescriptionGPUFitnessEvaluator
(GPUEAExecutionContext<T> _gpuEAExecutionContext, GPUEAConfiguration<T> _gpuEAConfiguration, ExecutorService _executorService) -
Method Summary
Modifier and TypeMethodDescriptionCompute the fitness for a list of genotypesprivate String
loadResource
(String filename) void
void
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
gpuEAExecutionContext
-
gpuEAConfiguration
-
executorService
-
selectedPlatformToDevice
-
clContexts
-
clCommandQueues
-
clPrograms
-
clKernels
-
clExecutionContexts
-
-
Constructor Details
-
GPUFitnessEvaluator
public GPUFitnessEvaluator(GPUEAExecutionContext<T> _gpuEAExecutionContext, GPUEAConfiguration<T> _gpuEAConfiguration, ExecutorService _executorService)
-
-
Method Details
-
loadResource
-
grabProgramSources
-
preEvaluation
public void preEvaluation()- Specified by:
preEvaluation
in interfaceFitnessEvaluator<T extends Comparable<T>>
-
evaluate
Description copied from interface:FitnessEvaluator
Compute the fitness for a list of genotypes- Specified by:
evaluate
in interfaceFitnessEvaluator<T extends Comparable<T>>
- Parameters:
genotypes
- Population to evaluate- Returns:
- Their associated fitnesses
-
postEvaluation
public void postEvaluation()- Specified by:
postEvaluation
in interfaceFitnessEvaluator<T extends Comparable<T>>
-