TournamentNSGA2SelectionPolicyHandlerFactory.java

1
package net.bmahe.genetics4j.moo.nsga2.impl;
2
3
import java.util.random.RandomGenerator;
4
5
import org.apache.commons.lang3.Validate;
6
7
import net.bmahe.genetics4j.core.selection.SelectionPolicyHandler;
8
import net.bmahe.genetics4j.core.selection.TournamentSelectionPolicyHandler;
9
import net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext;
10
import net.bmahe.genetics4j.core.spec.SelectionPolicyHandlerFactory;
11
12
public class TournamentNSGA2SelectionPolicyHandlerFactory<T extends Comparable<T>>
13
		implements SelectionPolicyHandlerFactory<T>
14
{
15
16
	@Override
17
	public SelectionPolicyHandler<T> apply(final AbstractEAExecutionContext<T> abstractEAExecutionContext) {
18
		Validate.notNull(abstractEAExecutionContext);
19
20 1 1. apply : removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED
		final RandomGenerator randomGenerator = abstractEAExecutionContext.randomGenerator();
21 2 1. apply : replaced return value with null for net/bmahe/genetics4j/moo/nsga2/impl/TournamentNSGA2SelectionPolicyHandlerFactory::apply → SURVIVED
2. apply : removed call to net/bmahe/genetics4j/moo/nsga2/impl/TournamentNSGA2SelectionPolicyHandler::<init> → SURVIVED
		return new TournamentNSGA2SelectionPolicyHandler<T>(randomGenerator);
22
	}
23
}

Mutations

20

1.1
Location : apply
Killed by : net.bmahe.genetics4j.moo.nsga2.impl.TournamentNSGA2SelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.moo.nsga2.impl.TournamentNSGA2SelectionPolicyHandlerTest]/[method:resolveWrongSelectionSpec()]
removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED

21

1.1
Location : apply
Killed by : none
replaced return value with null for net/bmahe/genetics4j/moo/nsga2/impl/TournamentNSGA2SelectionPolicyHandlerFactory::apply → SURVIVED
Covering tests

2.2
Location : apply
Killed by : none
removed call to net/bmahe/genetics4j/moo/nsga2/impl/TournamentNSGA2SelectionPolicyHandler::<init> → SURVIVED Covering tests

Active mutators

Tests examined


Report generated by PIT 1.19.6