1
|
|
package net.bmahe.genetics4j.core.spec; |
2
|
|
|
3
|
|
import java.util.Arrays; |
4
|
|
|
5
|
|
import org.immutables.value.Value; |
6
|
|
|
7
|
|
import net.bmahe.genetics4j.core.Fitness; |
8
|
|
import net.bmahe.genetics4j.core.spec.chromosome.ChromosomeSpec; |
9
|
|
import net.bmahe.genetics4j.core.spec.mutation.MutationPolicy; |
10
|
|
|
11
|
|
/** |
12
|
|
* Evolutionary Algorithm Configuration. |
13
|
|
* <p> |
14
|
|
* This describe the set of strategies to use. They describe the genotype, the |
15
|
|
* different policies for selection, combination as well as mutation, and other |
16
|
|
* relevant parameters such as how to determine the fitness of a given |
17
|
|
* individual. |
18
|
|
* |
19
|
|
* @param <T> Type of the fitness measurement |
20
|
|
*/ |
21
|
|
@Value.Immutable |
22
|
|
public abstract class EAConfiguration<T extends Comparable<T>> extends AbstractEAConfiguration<T> { |
23
|
|
|
24
|
|
/** |
25
|
|
* Defines how should individuals' fitness be assessed |
26
|
|
* |
27
|
|
* @return |
28
|
|
*/ |
29
|
|
public abstract Fitness<T> fitness(); |
30
|
|
|
31
|
|
public static class Builder<T extends Comparable<T>> extends ImmutableEAConfiguration.Builder<T> { |
32
|
|
|
33
|
|
public final EAConfiguration.Builder<T> chromosomeSpecs(final ChromosomeSpec... elements) { |
34
|
4
1. chromosomeSpecs : removed call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs → KILLED
2. chromosomeSpecs : replaced return value with null for net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs → KILLED
3. chromosomeSpecs : replaced call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs with receiver → KILLED
4. chromosomeSpecs : removed call to java/util/Arrays::asList → KILLED
|
return this.chromosomeSpecs(Arrays.asList(elements)); |
35
|
|
} |
36
|
|
|
37
|
|
public final EAConfiguration.Builder<T> mutationPolicies(final MutationPolicy... elements) { |
38
|
4
1. mutationPolicies : replaced call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies with receiver → SURVIVED
2. mutationPolicies : removed call to java/util/Arrays::asList → KILLED
3. mutationPolicies : removed call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies → KILLED
4. mutationPolicies : replaced return value with null for net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies → KILLED
|
return this.mutationPolicies(Arrays.asList(elements)); |
39
|
|
} |
40
|
|
} |
41
|
|
} |
| | Mutations |
34 |
|
1.1 Location : chromosomeSpecs Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs → KILLED
2.2 Location : chromosomeSpecs Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced return value with null for net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs → KILLED
3.3 Location : chromosomeSpecs Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs with receiver → KILLED
4.4 Location : chromosomeSpecs Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/Arrays::asList → KILLED
|
38 |
|
1.1 Location : mutationPolicies Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/Arrays::asList → KILLED
2.2 Location : mutationPolicies Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies → KILLED
3.3 Location : mutationPolicies Killed by : none replaced call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies with receiver → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testSystemConstruction()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvaluateOnce()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvaluateOnceWithDifferentGenerations()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithPostEvaluationProcessor()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithIntChromosome()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithBitChromosome()]
- net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithImmediateTermination()]
4.4 Location : mutationPolicies Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced return value with null for net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies → KILLED
|