DoubleChromosomeSpec.java

1
package net.bmahe.genetics4j.core.spec.chromosome;
2
3
import org.apache.commons.lang3.Validate;
4
import org.immutables.value.Value;
5
6
import net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution;
7
import net.bmahe.genetics4j.core.spec.statistics.distributions.UniformDistribution;
8
9
@Value.Immutable
10
public abstract class DoubleChromosomeSpec implements ChromosomeSpec {
11
12
	@Value.Parameter
13
	public abstract int size();
14
15
	@Value.Parameter
16
	public abstract double minValue();
17
18
	@Value.Parameter
19
	public abstract double maxValue();
20
21
	@Value.Default
22
	public Distribution distribution() {
23 2 1. distribution : replaced return value with null for net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec::distribution → KILLED
2. distribution : removed call to net/bmahe/genetics4j/core/spec/statistics/distributions/UniformDistribution::build → KILLED
		return UniformDistribution.build();
24
	}
25
26
	@Value.Check
27
	protected void check() {
28
		Validate.isTrue(size() > 0);
29
		Validate.isTrue(minValue() <= maxValue());
30
	}
31
32
	public static class Builder extends ImmutableDoubleChromosomeSpec.Builder {
33
	}
34
35
	/**
36
	 * Construct a new immutable {@code DoubleChromosomeSpec} instance.
37
	 * 
38
	 * @param size     The value for the {@code size} attribute
39
	 * @param minValue The value for the {@code minValue} attribute
40
	 * @param maxValue The value for the {@code maxValue} attribute
41
	 * @return An immutable DoubleChromosomeSpec instance
42
	 */
43
44
	public static DoubleChromosomeSpec of(final int size, final double minValue, final double maxValue) {
45 2 1. of : replaced return value with null for net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec::of → KILLED
2. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec::of → KILLED
		return ImmutableDoubleChromosomeSpec.of(size, minValue, maxValue);
46
	}
47
48
	public static DoubleChromosomeSpec of(final int size, final double minValue, final double maxValue,
49
			final Distribution distribution) {
50
		Validate.notNull(distribution);
51
52 1 1. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::<init> → NO_COVERAGE
		final var doubleChromosomeSpecBuilder = new ImmutableDoubleChromosomeSpec.Builder();
53
54 7 1. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::distribution → NO_COVERAGE
2. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::maxValue → NO_COVERAGE
3. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::minValue → NO_COVERAGE
4. of : replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::distribution with receiver → NO_COVERAGE
5. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::size → NO_COVERAGE
6. of : replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::minValue with receiver → NO_COVERAGE
7. of : replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::maxValue with receiver → NO_COVERAGE
		doubleChromosomeSpecBuilder.size(size).minValue(minValue).maxValue(maxValue).distribution(distribution);
55
56 2 1. of : removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::build → NO_COVERAGE
2. of : replaced return value with null for net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec::of → NO_COVERAGE
		return doubleChromosomeSpecBuilder.build();
57
	}
58
}

Mutations

23

1.1
Location : distribution
Killed by : net.bmahe.genetics4j.core.chromosomes.factory.DoubleChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.chromosomes.factory.DoubleChromosomeFactoryTest]/[method:canHandleTest()]
replaced return value with null for net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec::distribution → KILLED

2.2
Location : distribution
Killed by : net.bmahe.genetics4j.core.chromosomes.factory.DoubleChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.chromosomes.factory.DoubleChromosomeFactoryTest]/[method:canHandleTest()]
removed call to net/bmahe/genetics4j/core/spec/statistics/distributions/UniformDistribution::build → KILLED

45

1.1
Location : of
Killed by : net.bmahe.genetics4j.core.mutation.chromosome.randommutation.DoubleChromosomeRandomMutationHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.chromosome.randommutation.DoubleChromosomeRandomMutationHandlerTest]/[method:canHandle()]
replaced return value with null for net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec::of → KILLED

2.2
Location : of
Killed by : net.bmahe.genetics4j.core.mutation.chromosome.randommutation.DoubleChromosomeRandomMutationHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.mutation.chromosome.randommutation.DoubleChromosomeRandomMutationHandlerTest]/[method:canHandle()]
removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec::of → KILLED

52

1.1
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::<init> → NO_COVERAGE

54

1.1
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::distribution → NO_COVERAGE

2.2
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::maxValue → NO_COVERAGE

3.3
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::minValue → NO_COVERAGE

4.4
Location : of
Killed by : none
replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::distribution with receiver → NO_COVERAGE

5.5
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::size → NO_COVERAGE

6.6
Location : of
Killed by : none
replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::minValue with receiver → NO_COVERAGE

7.7
Location : of
Killed by : none
replaced call to net/bmahe/genetics4j/core/spec/chromosome/DoubleChromosomeSpec$Builder::maxValue with receiver → NO_COVERAGE

56

1.1
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/spec/chromosome/ImmutableDoubleChromosomeSpec$Builder::build → NO_COVERAGE

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

Active mutators

Tests examined


Report generated by PIT 1.19.6