1
|
|
package net.bmahe.genetics4j.gp.selection; |
2
|
|
|
3
|
|
import java.util.Objects; |
4
|
|
import java.util.random.RandomGenerator; |
5
|
|
|
6
|
|
import net.bmahe.genetics4j.core.selection.SelectionPolicyHandler; |
7
|
|
import net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext; |
8
|
|
import net.bmahe.genetics4j.core.spec.SelectionPolicyHandlerFactory; |
9
|
|
|
10
|
|
public class DoubleTournamentPolicyHandlerFactory<T extends Comparable<T>> implements SelectionPolicyHandlerFactory<T> { |
11
|
|
|
12
|
|
@Override |
13
|
|
public SelectionPolicyHandler<T> apply(final AbstractEAExecutionContext<T> eaExecutionContext) { |
14
|
|
Objects.requireNonNull(eaExecutionContext); |
15
|
|
|
16
|
1
1. apply : removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED
|
final RandomGenerator randomGenerator = eaExecutionContext.randomGenerator(); |
17
|
2
1. apply : replaced return value with null for net/bmahe/genetics4j/gp/selection/DoubleTournamentPolicyHandlerFactory::apply → SURVIVED
2. apply : removed call to net/bmahe/genetics4j/gp/selection/DoubleTournamentSelectionPolicyHandler::<init> → SURVIVED
|
return new DoubleTournamentSelectionPolicyHandler<>(randomGenerator); |
18
|
|
} |
19
|
|
|
20
|
|
} |
| | Mutations |
16 |
|
1.1 Location : apply Killed by : net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolveNoCombinationPolicy()] removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::randomGenerator → KILLED
|
17 |
|
1.1 Location : apply Killed by : none replaced return value with null for net/bmahe/genetics4j/gp/selection/DoubleTournamentPolicyHandlerFactory::apply → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolveNoCombinationPolicy()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolve()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:canHandle()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMaximize()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMaximizeAndDoFitnessLast()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolveNoChromosomeSpec()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMinimize()]
2.2 Location : apply Killed by : none removed call to net/bmahe/genetics4j/gp/selection/DoubleTournamentSelectionPolicyHandler::<init> → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolveNoCombinationPolicy()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolve()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:canHandle()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMaximize()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMaximizeAndDoFitnessLast()]
- net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.combination.ProgramRandomCombineHandlerTest]/[method:resolveNoChromosomeSpec()]
- net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.selection.DoubleTournamentSelectionPolicyHandlerTest]/[method:selectMinimize()]
|