EAExecutionContexts.java

1
package net.bmahe.genetics4j.core.spec;
2
3
import java.util.Objects;
4
5
import net.bmahe.genetics4j.core.selection.RouletteWheelSelectionPolicyHandler;
6
import net.bmahe.genetics4j.core.spec.ImmutableEAExecutionContext.Builder;
7
8
/**
9
 * Defines multiple factory and helper methods to create and manage EAExecutionContexts
10
 */
11
public class EAExecutionContexts {
12
13
	private EAExecutionContexts() {
14
	}
15
16
	public static <T extends Comparable<T>> Builder<T> standard() {
17 2 1. standard : removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext::builder → NO_COVERAGE
2. standard : replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::standard → NO_COVERAGE
		return ImmutableEAExecutionContext.<T>builder();
18
	}
19
20
	/**
21
	 * Enrich an EAExecutionContext builder based on the knowledge of the fitness function returning a scalar value.
22
	 * <p>This will enrich it with additional implementations for selecting, combining and mutating individuals.
23
	 * 
24
	 * @param <T>     Type of the fitness measurement
25
	 * @param builder
26
	 * @return Enriched EAExecutionContext builder
27
	 */
28
	public static <T extends Number & Comparable<T>> Builder<T> enrichForScalarFitness(final Builder<T> builder) {
29
		Objects.requireNonNull(builder);
30
31 2 1. enrichForScalarFitness : removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext$Builder::addSelectionPolicyHandlerFactories → SURVIVED
2. enrichForScalarFitness : replaced call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext$Builder::addSelectionPolicyHandlerFactories with receiver → SURVIVED
		builder.addSelectionPolicyHandlerFactories(
32 3 1. lambda$enrichForScalarFitness$0 : replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::lambda$enrichForScalarFitness$0 → SURVIVED
2. lambda$enrichForScalarFitness$0 : removed call to net/bmahe/genetics4j/core/selection/RouletteWheelSelectionPolicyHandler::<init> → SURVIVED
3. lambda$enrichForScalarFitness$0 : removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED
				gsd -> new RouletteWheelSelectionPolicyHandler<T>(gsd.randomGenerator()));
33 1 1. enrichForScalarFitness : replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness → KILLED
		return builder;
34
	}
35
36
	/**
37
	 * Create an EAExecutionContext builder based on the knowledge of the fitness function returning a scalar value.
38
	 * <p>This will enrich it with additional implementations for selecting, combining and mutating individuals.
39
	 * 
40
	 * @param <T>
41
	 * @return
42
	 */
43
	public static <T extends Number & Comparable<T>> Builder<T> forScalarFitness() {
44
45 1 1. forScalarFitness : removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext::builder → KILLED
		final Builder<T> builder = ImmutableEAExecutionContext.<T>builder();
46 3 1. forScalarFitness : replaced call to net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness with argument → SURVIVED
2. forScalarFitness : removed call to net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness → KILLED
3. forScalarFitness : replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::forScalarFitness → KILLED
		return enrichForScalarFitness(builder);
47
	}
48
}

Mutations

17

1.1
Location : standard
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext::builder → NO_COVERAGE

2.2
Location : standard
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::standard → NO_COVERAGE

31

1.1
Location : enrichForScalarFitness
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext$Builder::addSelectionPolicyHandlerFactories → SURVIVED
Covering tests

2.2
Location : enrichForScalarFitness
Killed by : none
replaced call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext$Builder::addSelectionPolicyHandlerFactories with receiver → SURVIVED Covering tests

32

1.1
Location : lambda$enrichForScalarFitness$0
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::lambda$enrichForScalarFitness$0 → SURVIVED
Covering tests

2.2
Location : lambda$enrichForScalarFitness$0
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:ctorNoSurvivorSelector()]
removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED

3.3
Location : lambda$enrichForScalarFitness$0
Killed by : none
removed call to net/bmahe/genetics4j/core/selection/RouletteWheelSelectionPolicyHandler::<init> → SURVIVED Covering tests

33

1.1
Location : enrichForScalarFitness
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:ctorNoSurvivorSelector()]
replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness → KILLED

45

1.1
Location : forScalarFitness
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:ctorNoSurvivorSelector()]
removed call to net/bmahe/genetics4j/core/spec/ImmutableEAExecutionContext::builder → KILLED

46

1.1
Location : forScalarFitness
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:ctorNoSurvivorSelector()]
removed call to net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness → KILLED

2.2
Location : forScalarFitness
Killed by : none
replaced call to net/bmahe/genetics4j/core/spec/EAExecutionContexts::enrichForScalarFitness with argument → SURVIVED
Covering tests

3.3
Location : forScalarFitness
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:ctorNoSurvivorSelector()]
replaced return value with null for net/bmahe/genetics4j/core/spec/EAExecutionContexts::forScalarFitness → KILLED

Active mutators

Tests examined


Report generated by PIT 1.20.3