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

Mutations

32

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

33

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
Substituted 0 with 1 → SURVIVED
Covering tests

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

3.3
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:ctorDifferentSizes()]
removed conditional - replaced equality check with true → KILLED

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

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

6.6
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/List::size → KILLED

7.7
Location : <init>
Killed by : none
Substituted 2 with 3 → SURVIVED Covering tests

8.8
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:ctorDifferentSizes()]
negated conditional → KILLED

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

49

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

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

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

50

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

52

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

53

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

67

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

68

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

80

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

81

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

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

93

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

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

94

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.DeleteNLastImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest]/[method:select()]
removed call to net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED

99

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

112

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

125

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

136

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

145

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

154

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

163

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

172

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

177

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

178

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

179

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

180

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

181

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

186

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

187

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

188

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

189

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

190

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

191

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

195

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

196

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

197

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

198

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

199

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

200

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

201

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

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
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

204

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

205

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

210

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

223

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

237

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

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

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

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

239

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

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

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

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

241

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

251

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.20.3