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

Mutations

140

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

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 outputNodeIndices → 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 connections → 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 activationFunction → KILLED

145

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

146

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

175

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

178

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

179

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

180

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

182

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

185

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

186

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

188

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

190

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

193

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

194

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

196

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

197

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

201

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 : none
removed call to net/bmahe/genetics4j/neat/Connection::fromNodeIndex → SURVIVED Covering tests

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

202

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

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

205

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

208

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

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

213

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

216

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

218

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

219

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

220

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

222

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

224

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