FeedForwardNetwork.java

1
package net.bmahe.genetics4j.neat;
2
3
import java.util.HashMap;
4
import java.util.List;
5
import java.util.Map;
6
import java.util.Objects;
7
import java.util.Set;
8
import java.util.function.Function;
9
10
import org.apache.commons.collections4.CollectionUtils;
11
import org.apache.commons.lang3.Validate;
12
import org.apache.logging.log4j.LogManager;
13
import org.apache.logging.log4j.Logger;
14
15
/**
16
 * Implements a feed-forward neural network for evaluating NEAT (NeuroEvolution of Augmenting Topologies) chromosomes.
17
 * 
18
 * <p>FeedForwardNetwork provides a computational engine for executing neural networks evolved by the NEAT algorithm. It
19
 * takes a network topology defined by connections and nodes, organizes them into computational layers, and provides
20
 * efficient forward propagation for fitness evaluation. The network supports arbitrary topologies with variable numbers
21
 * of hidden layers and connections, as long as the resulting graph remains acyclic. For chromosomes that contain
22
 * recurrent connections, use {@link RecurrentNetwork}.
23
 * 
24
 * <p>Key features:
25
 * <ul>
26
 * <li><strong>Dynamic topology</strong>: Supports arbitrary network structures evolved by NEAT</li>
27
 * <li><strong>Layer-based evaluation</strong>: Automatically computes optimal evaluation order</li>
28
 * <li><strong>Configurable activation</strong>: Supports any activation function for hidden and output nodes</li>
29
 * <li><strong>Efficient propagation</strong>: Optimized forward pass through network layers</li>
30
 * </ul>
31
 * 
32
 * <p>Network evaluation process:
33
 * <ol>
34
 * <li><strong>Input assignment</strong>: Input values are assigned to input nodes</li>
35
 * <li><strong>Layer computation</strong>: Each layer is computed in topological order</li>
36
 * <li><strong>Node activation</strong>: Each node applies weighted sum followed by activation function</li>
37
 * <li><strong>Output extraction</strong>: Output values are collected from designated output nodes</li>
38
 * </ol>
39
 * 
40
 * <p>Network construction workflow:
41
 * <ul>
42
 * <li><strong>Topology analysis</strong>: Network connections are analyzed to determine layer structure</li>
43
 * <li><strong>Layer partitioning</strong>: Nodes are organized into evaluation layers using topological sorting</li>
44
 * <li><strong>Connection mapping</strong>: Backward connections are precomputed for efficient evaluation</li>
45
 * <li><strong>Dead node removal</strong>: Unreachable nodes are excluded from computation</li>
46
 * </ul>
47
 * 
48
 * <p>Common usage patterns:
49
 * 
50
 * <pre>{@code
51
 * // Create network from NEAT chromosome
52
 * NeatChromosome chromosome = // ... obtain from evolution
53
 * Set<Integer> inputNodes = Set.of(0, 1, 2);
54
 * Set<Integer> outputNodes = Set.of(3, 4);
55
 * Function<Float, Float> activation = Activations::sigmoid;
56
 * 
57
 * FeedForwardNetwork network = new FeedForwardNetwork(
58
 *     inputNodes, outputNodes, chromosome.getConnections(), activation
59
 * );
60
 * 
61
 * // Evaluate network on input data
62
 * Map<Integer, Float> inputs = Map.of(0, 1.0f, 1, 0.5f, 2, -0.3f);
63
 * Map<Integer, Float> outputs = network.compute(inputs);
64
 * 
65
 * // Extract specific outputs
66
 * float output1 = outputs.get(3);
67
 * float output2 = outputs.get(4);
68
 * }</pre>
69
 * 
70
 * <p>Activation function integration:
71
 * <ul>
72
 * <li><strong>Sigmoid activation</strong>: Standard logistic function for binary classification</li>
73
 * <li><strong>Tanh activation</strong>: Hyperbolic tangent for continuous outputs</li>
74
 * <li><strong>Linear activation</strong>: Identity function for regression problems</li>
75
 * <li><strong>Custom functions</strong>: Any Function&lt;Float, Float&gt; can be used</li>
76
 * </ul>
77
 * 
78
 * <p>Performance optimizations:
79
 * <ul>
80
 * <li><strong>Layer precomputation</strong>: Network layers are computed once during construction</li>
81
 * <li><strong>Connection mapping</strong>: Backward connections are precomputed for fast lookup</li>
82
 * <li><strong>Dead node elimination</strong>: Unreachable nodes are excluded from evaluation</li>
83
 * <li><strong>Efficient propagation</strong>: Only enabled connections participate in computation</li>
84
 * </ul>
85
 * 
86
 * <p>Error handling and validation:
87
 * <ul>
88
 * <li><strong>Input validation</strong>: Ensures all input nodes receive values</li>
89
 * <li><strong>Output validation</strong>: Verifies all output nodes produce values</li>
90
 * <li><strong>Topology validation</strong>: Validates network structure during construction</li>
91
 * <li><strong>Connection consistency</strong>: Ensures connection endpoints reference valid nodes</li>
92
 * </ul>
93
 * 
94
 * <p>Integration with NEAT evolution:
95
 * <ul>
96
 * <li><strong>Chromosome evaluation</strong>: Converts NEAT chromosomes to executable networks</li>
97
 * <li><strong>Fitness computation</strong>: Provides network output for fitness evaluation</li>
98
 * <li><strong>Topology evolution</strong>: Supports networks with varying structure complexity</li>
99
 * <li><strong>Innovation tracking</strong>: Works with networks containing historical innovations</li>
100
 * </ul>
101
 * 
102
 * @see NeatChromosome
103
 * @see Connection
104
 * @see Activations
105
 * @see NeatUtils#partitionLayersNodes
106
 */
107
public class FeedForwardNetwork {
108
	public static final Logger logger = LogManager.getLogger(FeedForwardNetwork.class);
109
110
	private final Set<Integer> inputNodeIndices;
111
	private final Set<Integer> outputNodeIndices;
112
	private final List<Connection> connections;
113
114
	private final List<List<Integer>> layers;
115
	private final Map<Integer, Set<Connection>> backwardConnections;
116
117
	private final Function<Float, Float> activationFunction;
118
119
	/**
120
	 * Constructs a new feed-forward network with the specified topology and activation function.
121
	 * 
122
	 * <p>The constructor analyzes the network topology, computes evaluation layers using topological sorting, and
123
	 * precomputes connection mappings for efficient forward propagation. The network is immediately ready for evaluation
124
	 * after construction.
125
	 * 
126
	 * @param _inputNodeIndices   set of input node indices
127
	 * @param _outputNodeIndices  set of output node indices
128
	 * @param _connections        list of network connections defining the topology
129
	 * @param _activationFunction activation function to apply to hidden and output nodes
130
	 * @throws IllegalArgumentException if any parameter is null or empty
131
	 */
132
	public FeedForwardNetwork(final Set<Integer> _inputNodeIndices,
133
			final Set<Integer> _outputNodeIndices,
134
			final List<Connection> _connections,
135
			final Function<Float, Float> _activationFunction) {
136
		Validate.isTrue(CollectionUtils.isNotEmpty(_inputNodeIndices));
137
		Validate.isTrue(CollectionUtils.isNotEmpty(_outputNodeIndices));
138
		Validate.isTrue(CollectionUtils.isNotEmpty(_connections));
139
		Objects.requireNonNull(_activationFunction);
140
141 1 1. <init> : Removed assignment to member variable inputNodeIndices → KILLED
		this.inputNodeIndices = _inputNodeIndices;
142 1 1. <init> : Removed assignment to member variable outputNodeIndices → KILLED
		this.outputNodeIndices = _outputNodeIndices;
143 1 1. <init> : Removed assignment to member variable connections → KILLED
		this.connections = _connections;
144 1 1. <init> : Removed assignment to member variable activationFunction → KILLED
		this.activationFunction = _activationFunction;
145
146 3 1. <init> : removed call to net/bmahe/genetics4j/neat/NeatUtils::partitionLayersNodes → KILLED
2. <init> : replaced call to net/bmahe/genetics4j/neat/NeatUtils::partitionLayersNodes with argument → KILLED
3. <init> : Removed assignment to member variable layers → KILLED
		this.layers = NeatUtils.partitionLayersNodes(this.inputNodeIndices, this.outputNodeIndices, this.connections);
147 2 1. <init> : Removed assignment to member variable backwardConnections → KILLED
2. <init> : removed call to net/bmahe/genetics4j/neat/NeatUtils::computeBackwardConnections → KILLED
		this.backwardConnections = NeatUtils.computeBackwardConnections(this.connections);
148
	}
149
150
	/**
151
	 * Computes the network output for the given input values.
152
	 * 
153
	 * <p>This method performs forward propagation through the network, computing node activations layer by layer in
154
	 * topological order. Input values are assigned to input nodes, then each subsequent layer is computed by applying
155
	 * weighted sums and activation functions.
156
	 * 
157
	 * <p>The computation process:
158
	 * <ol>
159
	 * <li>Input values are assigned to input nodes</li>
160
	 * <li>For each layer (starting from first hidden layer):</li>
161
	 * <li>For each node in the layer:</li>
162
	 * <li>Compute weighted sum of inputs from previous layers</li>
163
	 * <li>Apply activation function to the sum</li>
164
	 * <li>Store the result for use in subsequent layers</li>
165
	 * <li>Extract and return output values from output nodes</li>
166
	 * </ol>
167
	 * 
168
	 * @param inputValues mapping from input node indices to their values
169
	 * @return mapping from output node indices to their computed values
170
	 * @throws IllegalArgumentException if inputValues is null, has wrong size, or missing required inputs
171
	 */
172
	public Map<Integer, Float> compute(final Map<Integer, Float> inputValues) {
173
		Objects.requireNonNull(inputValues);
174
		Validate.isTrue(inputValues.size() == inputNodeIndices.size());
175
176 1 1. compute : removed call to java/util/HashMap::<init> → KILLED
		final Map<Integer, Float> nodeValues = new HashMap<>();
177
178
		for (final Integer inputNodeIndex : inputNodeIndices) {
179 2 1. compute : replaced call to java/util/Map::get with argument → KILLED
2. compute : removed call to java/util/Map::get → KILLED
			Float nodeValue = inputValues.get(inputNodeIndex);
180 3 1. compute : removed conditional - replaced equality check with false → SURVIVED
2. compute : removed conditional - replaced equality check with true → KILLED
3. compute : negated conditional → KILLED
			if (nodeValue == null) {
181 1 1. compute : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
				throw new IllegalArgumentException("Input vector missing values for input node " + inputNodeIndex);
182
			}
183 2 1. compute : replaced call to java/util/Map::put with argument → KILLED
2. compute : removed call to java/util/Map::put → KILLED
			nodeValues.put(inputNodeIndex, nodeValue);
184
		}
185
186 1 1. compute : Substituted 1 with 0 → KILLED
		int layerIndex = 1;
187 5 1. compute : changed conditional boundary → KILLED
2. compute : removed call to java/util/List::size → KILLED
3. compute : removed conditional - replaced comparison check with true → KILLED
4. compute : negated conditional → KILLED
5. compute : removed conditional - replaced comparison check with false → KILLED
		while (layerIndex < layers.size()) {
188
189 1 1. compute : removed call to java/util/List::get → KILLED
			final List<Integer> layer = layers.get(layerIndex);
190
191 4 1. compute : removed conditional - replaced equality check with true → SURVIVED
2. compute : removed conditional - replaced equality check with false → KILLED
3. compute : negated conditional → KILLED
4. compute : removed call to org/apache/commons/collections4/CollectionUtils::isNotEmpty → KILLED
			if (CollectionUtils.isNotEmpty(layer)) {
192
193
				for (Integer nodeIndex : layer) {
194 1 1. compute : Substituted 0.0 with 1.0 → KILLED
					float sum = 0.0F;
195 3 1. compute : removed call to java/util/Set::of → SURVIVED
2. compute : removed call to java/util/Map::getOrDefault → KILLED
3. compute : replaced call to java/util/Map::getOrDefault with argument → KILLED
					final var incomingNodes = backwardConnections.getOrDefault(nodeIndex, Set.of());
196
					for (final Connection incomingConnection : incomingNodes) {
197 5 1. compute : removed conditional - replaced equality check with false → SURVIVED
2. compute : removed call to java/lang/Integer::intValue → KILLED
3. compute : removed conditional - replaced equality check with true → KILLED
4. compute : removed call to net/bmahe/genetics4j/neat/Connection::toNodeIndex → KILLED
5. compute : negated conditional → KILLED
						if (incomingConnection.toNodeIndex() != nodeIndex) {
198 1 1. compute : removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
							throw new IllegalStateException();
199
						}
200
201
						// Incoming connection may have been disabled and dangling
202 6 1. compute : removed conditional - replaced equality check with true → SURVIVED
2. compute : negated conditional → KILLED
3. compute : removed call to net/bmahe/genetics4j/neat/Connection::fromNodeIndex → KILLED
4. compute : removed call to java/lang/Integer::valueOf → KILLED
5. compute : removed conditional - replaced equality check with false → KILLED
6. compute : removed call to java/util/Map::containsKey → KILLED
						if (nodeValues.containsKey(incomingConnection.fromNodeIndex())) {
203 1 1. compute : removed call to net/bmahe/genetics4j/neat/Connection::weight → KILLED
							final float weight = incomingConnection.weight();
204 5 1. compute : removed call to java/util/Map::get → KILLED
2. compute : removed call to java/lang/Float::floatValue → KILLED
3. compute : replaced call to java/util/Map::get with argument → KILLED
4. compute : removed call to net/bmahe/genetics4j/neat/Connection::fromNodeIndex → KILLED
5. compute : removed call to java/lang/Integer::valueOf → KILLED
							final float incomingNodeValue = nodeValues.get(incomingConnection.fromNodeIndex());
205
206 2 1. compute : Replaced float multiplication with division → KILLED
2. compute : Replaced float addition with subtraction → KILLED
							sum += weight * incomingNodeValue;
207
						}
208
					}
209 3 1. compute : replaced call to java/util/function/Function::apply with argument → KILLED
2. compute : removed call to java/lang/Float::valueOf → KILLED
3. compute : removed call to java/util/function/Function::apply → KILLED
					final Float outputValue = activationFunction.apply(sum);
210 2 1. compute : replaced call to java/util/Map::put with argument → KILLED
2. compute : removed call to java/util/Map::put → KILLED
					nodeValues.put(nodeIndex, outputValue);
211
				}
212
			}
213
214 1 1. compute : Changed increment from 1 to -1 → KILLED
			layerIndex++;
215
		}
216
217 1 1. compute : removed call to java/util/HashMap::<init> → KILLED
		final Map<Integer, Float> outputValues = new HashMap<>();
218
		for (final Integer outputNodeIndex : outputNodeIndices) {
219 2 1. compute : replaced call to java/util/Map::get with argument → KILLED
2. compute : removed call to java/util/Map::get → KILLED
			final Float value = nodeValues.get(outputNodeIndex);
220 3 1. compute : removed conditional - replaced equality check with false → SURVIVED
2. compute : negated conditional → KILLED
3. compute : removed conditional - replaced equality check with true → KILLED
			if (value == null) {
221 1 1. compute : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
				throw new IllegalArgumentException("Missing output value for node " + outputNodeIndex);
222
			}
223 2 1. compute : replaced call to java/util/Map::put with argument → KILLED
2. compute : removed call to java/util/Map::put → KILLED
			outputValues.put(outputNodeIndex, value);
224
		}
225 1 1. compute : replaced return value with Collections.emptyMap for net/bmahe/genetics4j/neat/FeedForwardNetwork::compute → KILLED
		return outputValues;
226
	}
227
}

Mutations

141

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

142

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

143

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

144

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

146

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to net/bmahe/genetics4j/neat/NeatUtils::partitionLayersNodes → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to net/bmahe/genetics4j/neat/NeatUtils::partitionLayersNodes with argument → KILLED

3.3
Location : <init>
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
Removed assignment to member variable layers → KILLED

147

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

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to net/bmahe/genetics4j/neat/NeatUtils::computeBackwardConnections → KILLED

176

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/HashMap::<init> → KILLED

179

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::get with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::get → KILLED

180

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
negated conditional → KILLED

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

181

1.1
Location : compute
Killed by : none
removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE

183

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::put with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::put → KILLED

186

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

187

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
changed conditional boundary → KILLED

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

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced comparison check with true → KILLED

4.4
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
negated conditional → KILLED

5.5
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced comparison check with false → KILLED

189

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

191

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced equality check with false → KILLED

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

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
negated conditional → KILLED

4.4
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to org/apache/commons/collections4/CollectionUtils::isNotEmpty → KILLED

194

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
Substituted 0.0 with 1.0 → KILLED

195

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::getOrDefault → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::getOrDefault with argument → KILLED

3.3
Location : compute
Killed by : none
removed call to java/util/Set::of → SURVIVED
Covering tests

197

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/lang/Integer::intValue → KILLED

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

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

4.4
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to net/bmahe/genetics4j/neat/Connection::toNodeIndex → KILLED

5.5
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
negated conditional → KILLED

198

1.1
Location : compute
Killed by : none
removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE

202

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

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

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.SparseNodeLayoutIntegrationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.SparseNodeLayoutIntegrationTest]/[method:feedForwardAndRecurrentEvaluationSupportSparseIds()]
removed call to net/bmahe/genetics4j/neat/Connection::fromNodeIndex → KILLED

4.4
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/lang/Integer::valueOf → KILLED

5.5
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed conditional - replaced equality check with false → KILLED

6.6
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::containsKey → KILLED

203

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to net/bmahe/genetics4j/neat/Connection::weight → KILLED

204

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::get → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/lang/Float::floatValue → KILLED

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::get with argument → KILLED

4.4
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to net/bmahe/genetics4j/neat/Connection::fromNodeIndex → KILLED

5.5
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/lang/Integer::valueOf → KILLED

206

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
Replaced float multiplication with division → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
Replaced float addition with subtraction → KILLED

209

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/function/Function::apply with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/lang/Float::valueOf → KILLED

3.3
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/function/Function::apply → KILLED

210

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::put with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::put → KILLED

214

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
Changed increment from 1 to -1 → KILLED

217

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/HashMap::<init> → KILLED

219

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::get with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::get → KILLED

220

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

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

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

221

1.1
Location : compute
Killed by : none
removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE

223

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced call to java/util/Map::put with argument → KILLED

2.2
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
removed call to java/util/Map::put → KILLED

225

1.1
Location : compute
Killed by : net.bmahe.genetics4j.neat.FeedForwardNetworkTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.FeedForwardNetworkTest]/[method:simple()]
replaced return value with Collections.emptyMap for net/bmahe/genetics4j/neat/FeedForwardNetwork::compute → KILLED

Active mutators

Tests examined


Report generated by PIT 1.25.7 support