EAConfiguration.java

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>This describe the set of strategies to use. They describe the genotype, the different policies for selection,
14
 * combination as well as mutation, and other relevant parameters such as how to determine the fitness of a given
15
 * individual.
16
 * 
17
 * @param <T> Type of the fitness measurement
18
 */
19
@Value.Immutable
20
public abstract class EAConfiguration<T extends Comparable<T>> extends AbstractEAConfiguration<T> {
21
22
	/**
23
	 * Defines how should individuals' fitness be assessed
24
	 * 
25
	 * @return
26
	 */
27
	public abstract Fitness<T> fitness();
28
29
	public static class Builder<T extends Comparable<T>> extends ImmutableEAConfiguration.Builder<T> {
30
31
		public final EAConfiguration.Builder<T> chromosomeSpecs(final ChromosomeSpec... elements) {
32 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));
33
		}
34
35
		public final EAConfiguration.Builder<T> mutationPolicies(final MutationPolicy... elements) {
36 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));
37
		}
38
	}
39
}

Mutations

32

1.1
Location : chromosomeSpecs
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
removed call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs → KILLED

2.2
Location : chromosomeSpecs
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
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.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
replaced call to net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::chromosomeSpecs with receiver → KILLED

4.4
Location : chromosomeSpecs
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
removed call to java/util/Arrays::asList → KILLED

36

1.1
Location : mutationPolicies
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
removed call to java/util/Arrays::asList → KILLED

2.2
Location : mutationPolicies
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
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

4.4
Location : mutationPolicies
Killed by : net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.evaluation.FitnessEvaluatorVirtualThreadTest]/[method:testVirtualThreadFactory()]
replaced return value with null for net/bmahe/genetics4j/core/spec/EAConfiguration$Builder::mutationPolicies → KILLED

Active mutators

Tests examined


Report generated by PIT 1.20.3