1
|
|
package net.bmahe.genetics4j.gp.spec.mutation; |
2
|
|
|
3
|
|
import java.util.function.BiFunction; |
4
|
|
import java.util.function.Predicate; |
5
|
|
|
6
|
|
import org.apache.commons.lang3.Validate; |
7
|
|
import org.immutables.value.Value; |
8
|
|
|
9
|
|
import net.bmahe.genetics4j.core.chromosomes.TreeNode; |
10
|
|
import net.bmahe.genetics4j.gp.Operation; |
11
|
|
import net.bmahe.genetics4j.gp.program.Program; |
12
|
|
|
13
|
|
@Value.Immutable |
14
|
|
public interface Rule { |
15
|
|
|
16
|
|
@Value.Parameter |
17
|
|
Predicate<TreeNode<Operation<?>>> predicate(); |
18
|
|
|
19
|
|
@Value.Parameter |
20
|
|
BiFunction<Program, TreeNode<Operation<?>>, TreeNode<Operation<?>>> applicator(); |
21
|
|
|
22
|
|
default boolean test(final TreeNode<Operation<?>> root) { |
23
|
|
Validate.notNull(root); |
24
|
|
|
25
|
4
1. test : replaced boolean return with true for net/bmahe/genetics4j/gp/spec/mutation/Rule::test → KILLED
2. test : replaced boolean return with false for net/bmahe/genetics4j/gp/spec/mutation/Rule::test → KILLED
3. test : removed call to java/util/function/Predicate::test → KILLED
4. test : removed call to net/bmahe/genetics4j/gp/spec/mutation/Rule::predicate → KILLED
|
return predicate().test(root); |
26
|
|
} |
27
|
|
|
28
|
|
default TreeNode<Operation<?>> apply(final Program program, final TreeNode<Operation<?>> root) { |
29
|
|
Validate.notNull(program); |
30
|
|
Validate.notNull(root); |
31
|
|
|
32
|
4
1. apply : replaced call to java/util/function/BiFunction::apply with argument → KILLED
2. apply : replaced return value with null for net/bmahe/genetics4j/gp/spec/mutation/Rule::apply → KILLED
3. apply : removed call to java/util/function/BiFunction::apply → KILLED
4. apply : removed call to net/bmahe/genetics4j/gp/spec/mutation/Rule::applicator → KILLED
|
return applicator().apply(program, root); |
33
|
|
} |
34
|
|
} |
| | Mutations |
25 |
|
1.1 Location : test Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] replaced boolean return with true for net/bmahe/genetics4j/gp/spec/mutation/Rule::test → KILLED
2.2 Location : test Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] replaced boolean return with false for net/bmahe/genetics4j/gp/spec/mutation/Rule::test → KILLED
3.3 Location : test Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] removed call to java/util/function/Predicate::test → KILLED
4.4 Location : test Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] removed call to net/bmahe/genetics4j/gp/spec/mutation/Rule::predicate → KILLED
|
32 |
|
1.1 Location : apply Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] replaced call to java/util/function/BiFunction::apply with argument → KILLED
2.2 Location : apply Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] replaced return value with null for net/bmahe/genetics4j/gp/spec/mutation/Rule::apply → KILLED
3.3 Location : apply Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] removed call to java/util/function/BiFunction::apply → KILLED
4.4 Location : apply Killed by : net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.mutation.ProgramRulesApplicatorMutatorTest]/[method:dupplicateAndApplyWithOneApplicableRule()] removed call to net/bmahe/genetics4j/gp/spec/mutation/Rule::applicator → KILLED
|