Population.java

1
package net.bmahe.genetics4j.core;
2
3
import java.util.ArrayList;
4
import java.util.Iterator;
5
import java.util.List;
6
7
import org.apache.commons.lang3.Validate;
8
9
/**
10
 * Represents a population of individuals in an evolutionary algorithm.
11
 * 
12
 * <p>A population is a collection of {@link Individual}s, each consisting of a genotype and its associated fitness.
13
 * This class provides methods to manage, access, and iterate over the individuals in the population.
14
 * 
15
 * <p>Populations are mutable and support adding individuals, either individually or in bulk from other populations.
16
 * The class maintains parallel lists of genotypes and fitnesses for efficient access.
17
 * 
18
 * @param <T> the type of the fitness values, must be comparable for selection operations
19
 * @see Individual
20
 * @see Genotype
21
 */
22
public class Population<T extends Comparable<T>> implements Iterable<Individual<T>> {
23
24
	private List<Genotype> genotypes;
25
	private List<T> fitnesses;
26
27
	/**
28
	 * Creates an empty population.
29
	 */
30
	public Population() {
31 2 1. <init> : Removed assignment to member variable genotypes → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.genotypes = new ArrayList<>();
32 2 1. <init> : Removed assignment to member variable fitnesses → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.fitnesses = new ArrayList<>();
33
	}
34
35
	/**
36
	 * Creates a population with the specified genotypes and fitnesses.
37
	 * 
38
	 * @param _genotype the list of genotypes for the population
39
	 * @param _fitnesses the list of fitness values corresponding to the genotypes
40
	 * @throws IllegalArgumentException if genotypes or fitnesses are null, or if their sizes don't match
41
	 */
42
	public Population(final List<Genotype> _genotype, final List<T> _fitnesses) {
43
		Validate.notNull(_genotype);
44
		Validate.notNull(_fitnesses);
45
		Validate.isTrue(_genotype.size() == _fitnesses.size(),
46
				"Size of genotype (%d) does not match size of fitnesses (%d)",
47 3 1. <init> : removed call to java/lang/Integer::valueOf → SURVIVED
2. <init> : Substituted 1 with 0 → SURVIVED
3. <init> : removed call to java/util/List::size → SURVIVED
				_genotype.size(),
48 2 1. <init> : removed call to java/lang/Integer::valueOf → SURVIVED
2. <init> : removed call to java/util/List::size → SURVIVED
				_fitnesses.size());
49
50 2 1. <init> : Removed assignment to member variable genotypes → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.genotypes = new ArrayList<Genotype>(_genotype);
51 2 1. <init> : Removed assignment to member variable fitnesses → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.fitnesses = new ArrayList<>(_fitnesses);
52
	}
53
54
	/**
55
	 * Adds an individual to the population by specifying its genotype and fitness separately.
56
	 * 
57
	 * @param genotype the genotype of the individual to add
58
	 * @param fitness the fitness value of the individual to add
59
	 * @throws IllegalArgumentException if genotype or fitness is null
60
	 */
61
	public void add(final Genotype genotype, final T fitness) {
62
		Validate.notNull(genotype);
63
		Validate.notNull(fitness);
64
65 1 1. add : removed call to java/util/List::add → KILLED
		genotypes.add(genotype);
66 1 1. add : removed call to java/util/List::add → KILLED
		fitnesses.add(fitness);
67
	}
68
69
	/**
70
	 * Adds an individual to the population.
71
	 * 
72
	 * @param individual the individual to add to the population
73
	 * @throws IllegalArgumentException if individual is null
74
	 */
75
	public void add(final Individual<T> individual) {
76
		Validate.notNull(individual);
77
78 2 1. add : removed call to java/util/List::add → TIMED_OUT
2. add : removed call to net/bmahe/genetics4j/core/Individual::genotype → KILLED
		genotypes.add(individual.genotype());
79 2 1. add : removed call to net/bmahe/genetics4j/core/Individual::fitness → KILLED
2. add : removed call to java/util/List::add → KILLED
		fitnesses.add(individual.fitness());
80
	}
81
82
	/**
83
	 * Adds all individuals from another population to this population.
84
	 * 
85
	 * @param population the population whose individuals should be added to this population
86
	 * @throws IllegalArgumentException if population is null
87
	 */
88
	public void addAll(final Population<T> population) {
89
		Validate.notNull(population);
90
91 2 1. addAll : removed call to java/util/List::addAll → KILLED
2. addAll : removed call to net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED
		this.genotypes.addAll(population.getAllGenotypes());
92 2 1. addAll : removed call to java/util/List::addAll → KILLED
2. addAll : removed call to net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED
		this.fitnesses.addAll(population.getAllFitnesses());
93
	}
94
95
	@Override
96
	public Iterator<Individual<T>> iterator() {
97 2 1. iterator : replaced return value with null for net/bmahe/genetics4j/core/Population::iterator → KILLED
2. iterator : removed call to net/bmahe/genetics4j/core/PopulationIterator::<init> → KILLED
		return new PopulationIterator<>(this);
98
	}
99
100
	/**
101
	 * Returns the genotype at the specified index.
102
	 * 
103
	 * @param index the index of the genotype to retrieve (0-based)
104
	 * @return the genotype at the specified index
105
	 * @throws IllegalArgumentException if index is out of bounds
106
	 */
107
	public Genotype getGenotype(final int index) {
108
		Validate.inclusiveBetween(0, genotypes.size() - 1, index);
109
110 2 1. getGenotype : removed call to java/util/List::get → KILLED
2. getGenotype : replaced return value with null for net/bmahe/genetics4j/core/Population::getGenotype → KILLED
		return genotypes.get(index);
111
	}
112
113
	/**
114
	 * Returns the fitness value at the specified index.
115
	 * 
116
	 * @param index the index of the fitness value to retrieve (0-based)
117
	 * @return the fitness value at the specified index
118
	 * @throws IllegalArgumentException if index is out of bounds
119
	 */
120
	public T getFitness(final int index) {
121
		Validate.inclusiveBetween(0, fitnesses.size() - 1, index);
122
123 2 1. getFitness : replaced return value with null for net/bmahe/genetics4j/core/Population::getFitness → KILLED
2. getFitness : removed call to java/util/List::get → KILLED
		return fitnesses.get(index);
124
	}
125
126
	/**
127
	 * Returns the individual at the specified index.
128
	 * 
129
	 * @param index the index of the individual to retrieve (0-based)
130
	 * @return the individual at the specified index, combining its genotype and fitness
131
	 * @throws IllegalArgumentException if index is out of bounds
132
	 */
133
	public Individual<T> getIndividual(final int index) {
134 4 1. getIndividual : removed call to net/bmahe/genetics4j/core/Population::getGenotype → KILLED
2. getIndividual : removed call to net/bmahe/genetics4j/core/Population::getFitness → KILLED
3. getIndividual : replaced return value with null for net/bmahe/genetics4j/core/Population::getIndividual → KILLED
4. getIndividual : removed call to net/bmahe/genetics4j/core/Individual::of → KILLED
		return Individual.of(getGenotype(index), getFitness(index));
135
	}
136
137
	/**
138
	 * Returns all genotypes in this population.
139
	 * 
140
	 * @return a list containing all genotypes in this population
141
	 */
142
	public List<Genotype> getAllGenotypes() {
143 1 1. getAllGenotypes : replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED
		return genotypes;
144
	}
145
146
	/**
147
	 * Returns all fitness values in this population.
148
	 * 
149
	 * @return a list containing all fitness values in this population
150
	 */
151
	public List<T> getAllFitnesses() {
152 1 1. getAllFitnesses : replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED
		return fitnesses;
153
	}
154
155
	/**
156
	 * Returns the number of individuals in this population.
157
	 * 
158
	 * @return the size of the population
159
	 */
160
	public int size() {
161 2 1. size : replaced int return with 0 for net/bmahe/genetics4j/core/Population::size → KILLED
2. size : removed call to java/util/List::size → KILLED
		return genotypes.size();
162
	}
163
164
	/**
165
	 * Checks if this population is empty.
166
	 * 
167
	 * @return {@code true} if the population contains no individuals, {@code false} otherwise
168
	 */
169
	public boolean isEmpty() {
170 7 1. isEmpty : removed call to net/bmahe/genetics4j/core/Population::size → KILLED
2. isEmpty : Substituted 1 with 0 → KILLED
3. isEmpty : negated conditional → KILLED
4. isEmpty : removed conditional - replaced equality check with false → KILLED
5. isEmpty : removed conditional - replaced equality check with true → KILLED
6. isEmpty : Substituted 0 with 1 → KILLED
7. isEmpty : replaced boolean return with true for net/bmahe/genetics4j/core/Population::isEmpty → KILLED
		return size() == 0;
171
	}
172
173
	@Override
174
	public int hashCode() {
175 1 1. hashCode : Substituted 31 with 32 → NO_COVERAGE
		final int prime = 31;
176 1 1. hashCode : Substituted 1 with 0 → NO_COVERAGE
		int result = 1;
177 8 1. hashCode : Substituted 0 with 1 → NO_COVERAGE
2. hashCode : negated conditional → NO_COVERAGE
3. hashCode : Substituted 31 with 32 → NO_COVERAGE
4. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
5. hashCode : removed call to java/util/List::hashCode → NO_COVERAGE
6. hashCode : removed conditional - replaced equality check with false → NO_COVERAGE
7. hashCode : removed conditional - replaced equality check with true → NO_COVERAGE
8. hashCode : Replaced integer multiplication with division → NO_COVERAGE
		result = prime * result + ((fitnesses == null) ? 0 : fitnesses.hashCode());
178 8 1. hashCode : removed call to java/util/List::hashCode → NO_COVERAGE
2. hashCode : Replaced integer multiplication with division → NO_COVERAGE
3. hashCode : Substituted 0 with 1 → NO_COVERAGE
4. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
5. hashCode : negated conditional → NO_COVERAGE
6. hashCode : Substituted 31 with 32 → NO_COVERAGE
7. hashCode : removed conditional - replaced equality check with false → NO_COVERAGE
8. hashCode : removed conditional - replaced equality check with true → NO_COVERAGE
		result = prime * result + ((genotypes == null) ? 0 : genotypes.hashCode());
179 1 1. hashCode : replaced int return with 0 for net/bmahe/genetics4j/core/Population::hashCode → NO_COVERAGE
		return result;
180
	}
181
182
	@Override
183
	public boolean equals(Object obj) {
184 2 1. equals : negated conditional → KILLED
2. equals : removed conditional - replaced equality check with true → KILLED
		if (this == obj)
185 2 1. equals : replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 1 with 0 → NO_COVERAGE
			return true;
186 3 1. equals : negated conditional → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : removed conditional - replaced equality check with false → SURVIVED
		if (obj == null)
187 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
			return false;
188 5 1. equals : removed call to java/lang/Object::getClass → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : removed conditional - replaced equality check with false → SURVIVED
5. equals : removed call to java/lang/Object::getClass → SURVIVED
		if (getClass() != obj.getClass())
189 2 1. equals : Substituted 0 with 1 → NO_COVERAGE
2. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
			return false;
190
191
		@SuppressWarnings("rawtypes")
192
		Population other = (Population) obj;
193 3 1. equals : removed conditional - replaced equality check with true → SURVIVED
2. equals : removed conditional - replaced equality check with false → SURVIVED
3. equals : negated conditional → SURVIVED
		if (fitnesses == null) {
194 3 1. equals : removed conditional - replaced equality check with false → NO_COVERAGE
2. equals : negated conditional → NO_COVERAGE
3. equals : removed conditional - replaced equality check with true → NO_COVERAGE
			if (other.fitnesses != null)
195 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
				return false;
196 4 1. equals : removed call to java/util/List::equals → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : removed conditional - replaced equality check with false → SURVIVED
		} else if (!fitnesses.equals(other.fitnesses))
197 2 1. equals : Substituted 0 with 1 → KILLED
2. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → KILLED
			return false;
198 3 1. equals : removed conditional - replaced equality check with true → NO_COVERAGE
2. equals : removed conditional - replaced equality check with false → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
		if (genotypes == null) {
199 3 1. equals : removed conditional - replaced equality check with true → NO_COVERAGE
2. equals : removed conditional - replaced equality check with false → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
			if (other.genotypes != null)
200 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
				return false;
201 4 1. equals : removed conditional - replaced equality check with false → NO_COVERAGE
2. equals : removed call to java/util/List::equals → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
4. equals : removed conditional - replaced equality check with true → NO_COVERAGE
		} else if (!genotypes.equals(other.genotypes))
202 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
			return false;
203 2 1. equals : Substituted 1 with 0 → NO_COVERAGE
2. equals : replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
		return true;
204
	}
205
206
	@Override
207
	public String toString() {
208 3 1. toString : removed call to java/lang/String::valueOf → SURVIVED
2. toString : replaced return value with "" for net/bmahe/genetics4j/core/Population::toString → SURVIVED
3. toString : removed call to java/lang/String::valueOf → SURVIVED
		return "Population [genotypes=" + genotypes + ", fitnesses=" + fitnesses + "]";
209
	}
210
211
	/**
212
	 * Creates a new population with the specified genotypes and fitnesses.
213
	 * 
214
	 * @param <U> the type of the fitness values
215
	 * @param _genotype the list of genotypes for the population
216
	 * @param _fitnesses the list of fitness values corresponding to the genotypes
217
	 * @return a new population containing the specified genotypes and fitnesses
218
	 * @throws IllegalArgumentException if genotypes or fitnesses are null, or if their sizes don't match
219
	 */
220
	public static <U extends Comparable<U>> Population<U> of(final List<Genotype> _genotype, final List<U> _fitnesses) {
221 2 1. of : removed call to net/bmahe/genetics4j/core/Population::<init> → KILLED
2. of : replaced return value with null for net/bmahe/genetics4j/core/Population::of → KILLED
		return new Population<U>(_genotype, _fitnesses);
222
	}
223
224
	/**
225
	 * Creates a new population from a list of individuals.
226
	 * 
227
	 * @param <U> the type of the fitness values
228
	 * @param individuals the list of individuals to include in the population
229
	 * @return a new population containing the specified individuals
230
	 * @throws IllegalArgumentException if individuals list is null
231
	 */
232
	public static <U extends Comparable<U>> Population<U> of(final List<Individual<U>> individuals) {
233
		Validate.notNull(individuals);
234
235 1 1. of : removed call to java/util/List::stream → NO_COVERAGE
		final List<Genotype> genotypes = individuals.stream()
236 2 1. of : removed call to java/util/stream/Stream::map → NO_COVERAGE
2. of : replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE
				.map(Individual::genotype)
237 1 1. of : removed call to java/util/stream/Stream::toList → NO_COVERAGE
				.toList();
238
239 1 1. of : removed call to java/util/List::stream → NO_COVERAGE
		final List<U> fitnesses = individuals.stream()
240 2 1. of : replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE
2. of : removed call to java/util/stream/Stream::map → NO_COVERAGE
				.map(Individual::fitness)
241 1 1. of : removed call to java/util/stream/Stream::toList → NO_COVERAGE
				.toList();
242
243 2 1. of : replaced return value with null for net/bmahe/genetics4j/core/Population::of → NO_COVERAGE
2. of : removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE
		return new Population<U>(genotypes, fitnesses);
244
	}
245
246
	/**
247
	 * Creates an empty population.
248
	 * 
249
	 * @param <U> the type of the fitness values
250
	 * @return a new empty population
251
	 */
252
	public static <U extends Comparable<U>> Population<U> empty() {
253 4 1. empty : replaced return value with null for net/bmahe/genetics4j/core/Population::empty → NO_COVERAGE
2. empty : removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE
3. empty : removed call to java/util/List::of → NO_COVERAGE
4. empty : removed call to java/util/List::of → NO_COVERAGE
		return new Population<U>(List.of(), List.of());
254
	}
255
256
}

Mutations

31

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
Removed assignment to member variable genotypes → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
removed call to java/util/ArrayList::<init> → KILLED

32

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
Removed assignment to member variable fitnesses → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

47

1.1
Location : <init>
Killed by : none
removed call to java/lang/Integer::valueOf → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
Substituted 1 with 0 → SURVIVED Covering tests

3.3
Location : <init>
Killed by : none
removed call to java/util/List::size → SURVIVED Covering tests

48

1.1
Location : <init>
Killed by : none
removed call to java/lang/Integer::valueOf → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
removed call to java/util/List::size → SURVIVED Covering tests

50

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Removed assignment to member variable genotypes → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

51

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Removed assignment to member variable fitnesses → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

65

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::add → KILLED

66

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to java/util/List::add → KILLED

78

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.selection.TournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.selection.TournamentSelectionPolicyHandlerTest]/[method:selectMaximize()]
removed call to net/bmahe/genetics4j/core/Individual::genotype → KILLED

2.2
Location : add
Killed by : none
removed call to java/util/List::add → TIMED_OUT

79

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithPostEvaluationProcessor()]
removed call to net/bmahe/genetics4j/core/Individual::fitness → KILLED

2.2
Location : add
Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithPostEvaluationProcessor()]
removed call to java/util/List::add → KILLED

91

1.1
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:simple()]
removed call to java/util/List::addAll → KILLED

2.2
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED

92

1.1
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:simple()]
removed call to java/util/List::addAll → KILLED

2.2
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED

97

1.1
Location : iterator
Killed by : net.bmahe.genetics4j.core.PopulationIteratorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationIteratorTest]/[method:iteratorIntegrationWithEnhancedForLoop()]
replaced return value with null for net/bmahe/genetics4j/core/Population::iterator → KILLED

2.2
Location : iterator
Killed by : net.bmahe.genetics4j.core.PopulationIteratorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationIteratorTest]/[method:iteratorIntegrationWithEnhancedForLoop()]
removed call to net/bmahe/genetics4j/core/PopulationIterator::<init> → KILLED

110

1.1
Location : getGenotype
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::get → KILLED

2.2
Location : getGenotype
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getGenotype → KILLED

123

1.1
Location : getFitness
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getFitness → KILLED

2.2
Location : getFitness
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::get → KILLED

134

1.1
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getGenotype → KILLED

2.2
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getFitness → KILLED

3.3
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getIndividual → KILLED

4.4
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Individual::of → KILLED

143

1.1
Location : getAllGenotypes
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED

152

1.1
Location : getAllFitnesses
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED

161

1.1
Location : size
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced int return with 0 for net/bmahe/genetics4j/core/Population::size → KILLED

2.2
Location : size
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::size → KILLED

170

1.1
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::size → KILLED

2.2
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
Substituted 1 with 0 → KILLED

3.3
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
negated conditional → KILLED

4.4
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
removed conditional - replaced equality check with false → KILLED

5.5
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

6.6
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Substituted 0 with 1 → KILLED

7.7
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced boolean return with true for net/bmahe/genetics4j/core/Population::isEmpty → KILLED

175

1.1
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

176

1.1
Location : hashCode
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

177

1.1
Location : hashCode
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

2.2
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

4.4
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : hashCode
Killed by : none
removed call to java/util/List::hashCode → NO_COVERAGE

6.6
Location : hashCode
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

7.7
Location : hashCode
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

8.8
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

178

1.1
Location : hashCode
Killed by : none
removed call to java/util/List::hashCode → NO_COVERAGE

2.2
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

3.3
Location : hashCode
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

4.4
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

7.7
Location : hashCode
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

8.8
Location : hashCode
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

179

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for net/bmahe/genetics4j/core/Population::hashCode → NO_COVERAGE

184

1.1
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
negated conditional → KILLED

2.2
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

185

1.1
Location : equals
Killed by : none
replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

186

1.1
Location : equals
Killed by : none
negated conditional → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

187

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

188

1.1
Location : equals
Killed by : none
removed call to java/lang/Object::getClass → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

5.5
Location : equals
Killed by : none
removed call to java/lang/Object::getClass → SURVIVED Covering tests

189

1.1
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

193

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

194

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

195

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

196

1.1
Location : equals
Killed by : none
removed call to java/util/List::equals → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

197

1.1
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Substituted 0 with 1 → KILLED

2.2
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → KILLED

198

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

199

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

200

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

201

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed call to java/util/List::equals → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

202

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

203

1.1
Location : equals
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

208

1.1
Location : toString
Killed by : none
removed call to java/lang/String::valueOf → SURVIVED
Covering tests

2.2
Location : toString
Killed by : none
replaced return value with "" for net/bmahe/genetics4j/core/Population::toString → SURVIVED Covering tests

3.3
Location : toString
Killed by : none
removed call to java/lang/String::valueOf → SURVIVED Covering tests

221

1.1
Location : of
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::<init> → KILLED

2.2
Location : of
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::of → KILLED

235

1.1
Location : of
Killed by : none
removed call to java/util/List::stream → NO_COVERAGE

236

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::map → NO_COVERAGE

2.2
Location : of
Killed by : none
replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE

237

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::toList → NO_COVERAGE

239

1.1
Location : of
Killed by : none
removed call to java/util/List::stream → NO_COVERAGE

240

1.1
Location : of
Killed by : none
replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE

2.2
Location : of
Killed by : none
removed call to java/util/stream/Stream::map → NO_COVERAGE

241

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::toList → NO_COVERAGE

243

1.1
Location : of
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/Population::of → NO_COVERAGE

2.2
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE

253

1.1
Location : empty
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/Population::empty → NO_COVERAGE

2.2
Location : empty
Killed by : none
removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE

3.3
Location : empty
Killed by : none
removed call to java/util/List::of → NO_COVERAGE

4.4
Location : empty
Killed by : none
removed call to java/util/List::of → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.19.6