java.lang.Object
io.jenetics.engine.Evaluators
This class contains factory methods for creating commonly usable
Evaluator implementations.- Since:
- 5.0
- Version:
- 8.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <G extends Gene<?,G>, C extends Comparable<? super C>>
Evaluator<G, C> Return a new fitness evaluator, which evaluates asynchronous fitness functions.static <T,G extends Gene<?, G>, C extends Comparable<? super C>>
Evaluator<G, C> Return a new fitness evaluator, which evaluates asynchronous fitness functions.static <T,G extends Gene<?, G>, C extends Comparable<? super C>>
Evaluator<G, C> async(Function<? super T, ? extends Future<C>> fitness, Function<? super Genotype<G>, ? extends T> decoder) Return a new fitness evaluator, which evaluates asynchronous fitness functions.static <G extends Gene<?,G>, C extends Comparable<? super C>>
Evaluator<G, C> completable(Function<? super Genotype<G>, ? extends CompletableFuture<C>> fitness) Return a new fitness evaluator, which evaluates asynchronous fitness functions.static <T,G extends Gene<?, G>, C extends Comparable<? super C>>
Evaluator<G, C> completable(Function<? super T, ? extends CompletableFuture<C>> fitness, Codec<T, G> codec) Return a new fitness evaluator, which evaluates asynchronous fitness functions.static <T,G extends Gene<?, G>, C extends Comparable<? super C>>
Evaluator<G, C> completable(Function<? super T, ? extends CompletableFuture<C>> fitness, Function<? super Genotype<G>, ? extends T> decoder) Return a new fitness evaluator, which evaluates asynchronous fitness functions.
-
Method Details
-
async
public static <G extends Gene<?,G>, Evaluator<G,C extends Comparable<? super C>> C> async(Function<? super Genotype<G>, ? extends Future<C>> fitness) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
G- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function- Returns:
- a new (asynchronous) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull- See Also:
-
async
public static <T,G extends Gene<?, Evaluator<G,G>, C extends Comparable<? super C>> C> async(Function<? super T, ? extends Future<C>> fitness, Function<? super Genotype<G>, ? extends T> decoder) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
T- the native fitness domain typeG- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function, working on the native fitness domaindecoder- the decoder function for the fitness domain- Returns:
- a new (async) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull
-
async
public static <T,G extends Gene<?, Evaluator<G,G>, C extends Comparable<? super C>> C> async(Function<? super T, ? extends Future<C>> fitness, Codec<T, G> codec) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
T- the native fitness domain typeG- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function, working on the native fitness domaincodec- the codec used for transforming the fitness domain- Returns:
- a new (async) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull
-
completable
public static <G extends Gene<?,G>, Evaluator<G,C extends Comparable<? super C>> C> completable(Function<? super Genotype<G>, ? extends CompletableFuture<C>> fitness) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
G- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function- Returns:
- a new (asynchronous) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull- See Also:
-
completable
public static <T,G extends Gene<?, Evaluator<G,G>, C extends Comparable<? super C>> C> completable(Function<? super T, ? extends CompletableFuture<C>> fitness, Function<? super Genotype<G>, ? extends T> decoder) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
T- the native fitness domain typeG- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function, working on the native fitness domaindecoder- the decoder function for the fitness domain- Returns:
- a new (async) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull
-
completable
public static <T,G extends Gene<?, Evaluator<G,G>, C extends Comparable<? super C>> C> completable(Function<? super T, ? extends CompletableFuture<C>> fitness, Codec<T, G> codec) Return a new fitness evaluator, which evaluates asynchronous fitness functions.- Type Parameters:
T- the native fitness domain typeG- the gene typeC- the fitness value type- Parameters:
fitness- the asynchronous fitness function, working on the native fitness domaincodec- the codec used for transforming the fitness domain- Returns:
- a new (async) fitness evaluator
- Throws:
NullPointerException- if one of the arguments isnull
-