NeatEmptyChromosomeFactory.java

1
package net.bmahe.genetics4j.neat.chromosomes.factory;
2
3
import java.util.List;
4
import java.util.Objects;
5
6
import org.apache.commons.lang3.Validate;
7
8
import net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactory;
9
import net.bmahe.genetics4j.core.spec.chromosome.ChromosomeSpec;
10
import net.bmahe.genetics4j.neat.chromosomes.NeatChromosome;
11
import net.bmahe.genetics4j.neat.spec.NeatChromosomeSpec;
12
13
public class NeatEmptyChromosomeFactory implements ChromosomeFactory<NeatChromosome> {
14
15
	@Override
16
	public boolean canHandle(final ChromosomeSpec chromosomeSpec) {
17
		Objects.requireNonNull(chromosomeSpec);
18
19 2 1. canHandle : replaced boolean return with false for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::canHandle → KILLED
2. canHandle : replaced boolean return with true for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::canHandle → KILLED
		return chromosomeSpec instanceof NeatChromosomeSpec;
20
	}
21
22
	@Override
23
	public NeatChromosome generate(ChromosomeSpec chromosomeSpec) {
24
		Objects.requireNonNull(chromosomeSpec);
25
		Validate.isInstanceOf(NeatChromosomeSpec.class, chromosomeSpec);
26
27
		final NeatChromosomeSpec neatChromosomeSpec = (NeatChromosomeSpec) chromosomeSpec;
28 1 1. generate : removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::nodeLayout → KILLED
		final var nodeLayout = neatChromosomeSpec.nodeLayout();
29 1 1. generate : removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::minWeightValue → KILLED
		float minWeightValue = neatChromosomeSpec.minWeightValue();
30 1 1. generate : removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::maxWeightValue → KILLED
		float maxWeightValue = neatChromosomeSpec.maxWeightValue();
31
32 3 1. generate : replaced return value with null for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::generate → KILLED
2. generate : removed call to java/util/List::of → KILLED
3. generate : removed call to net/bmahe/genetics4j/neat/chromosomes/NeatChromosome::<init> → KILLED
		return new NeatChromosome(nodeLayout, minWeightValue, maxWeightValue, List.of());
33
	}
34
}

Mutations

19

1.1
Location : canHandle
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:canHandle()]
replaced boolean return with false for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::canHandle → KILLED

2.2
Location : canHandle
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:invalidCanHandle()]
replaced boolean return with true for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::canHandle → KILLED

28

1.1
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::nodeLayout → KILLED

29

1.1
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::minWeightValue → KILLED

30

1.1
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
removed call to net/bmahe/genetics4j/neat/spec/NeatChromosomeSpec::maxWeightValue → KILLED

32

1.1
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
replaced return value with null for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::generate → KILLED

2.2
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
removed call to java/util/List::of → KILLED

3.3
Location : generate
Killed by : net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.chromosomes.factory.NeatEmptyChromosomeFactoryTest]/[method:generate()]
removed call to net/bmahe/genetics4j/neat/chromosomes/NeatChromosome::<init> → KILLED

Active mutators

Tests examined


Report generated by PIT 1.23.1 support