DoubleChromosomeSpec.java

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

Mutations

25

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

47

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

54

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

56

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

58

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.25.7 support