NeatEmptyChromosomeFactory.java

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

Mutations

18

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

27

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::numInputs → 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::numOutputs → 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()]
removed call to java/util/List::of → 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()]
replaced return value with null for net/bmahe/genetics4j/neat/chromosomes/factory/NeatEmptyChromosomeFactory::generate → 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.19.6