1
|
|
package net.bmahe.genetics4j.core.combination; |
2
|
|
|
3
|
|
import java.util.List; |
4
|
|
|
5
|
|
import org.apache.commons.lang3.Validate; |
6
|
|
|
7
|
|
import net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext; |
8
|
|
import net.bmahe.genetics4j.core.spec.chromosome.ChromosomeSpec; |
9
|
|
import net.bmahe.genetics4j.core.spec.combination.CombinationPolicy; |
10
|
|
|
11
|
|
public class ChromosomeCombinatorResolver<T extends Comparable<T>> { |
12
|
|
|
13
|
|
private final AbstractEAExecutionContext<T> eaExecutionContext; |
14
|
|
private List<ChromosomeCombinatorHandler<T>> chromosomeCombinatorHandlers; |
15
|
|
|
16
|
|
public ChromosomeCombinatorResolver(final AbstractEAExecutionContext<T> _eaExecutionContext) { |
17
|
|
Validate.notNull(_eaExecutionContext); |
18
|
|
|
19
|
1
1. <init> : Removed assignment to member variable eaExecutionContext → KILLED
|
this.eaExecutionContext = _eaExecutionContext; |
20
|
2
1. <init> : removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::chromosomeCombinatorHandlers → KILLED
2. <init> : Removed assignment to member variable chromosomeCombinatorHandlers → KILLED
|
this.chromosomeCombinatorHandlers = eaExecutionContext.chromosomeCombinatorHandlers(); |
21
|
|
} |
22
|
|
|
23
|
|
public boolean canHandle(final CombinationPolicy combinationPolicy, final ChromosomeSpec chromosome) { |
24
|
|
Validate.notNull(combinationPolicy); |
25
|
|
Validate.notNull(chromosome); |
26
|
|
|
27
|
3
1. canHandle : removed call to java/util/List::stream → NO_COVERAGE
2. canHandle : replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::canHandle → NO_COVERAGE
3. canHandle : replaced boolean return with false for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::canHandle → NO_COVERAGE
|
return chromosomeCombinatorHandlers.stream() |
28
|
4
1. canHandle : removed call to java/util/stream/Stream::anyMatch → NO_COVERAGE
2. lambda$canHandle$0 : removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::canHandle → NO_COVERAGE
3. lambda$canHandle$0 : replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$canHandle$0 → NO_COVERAGE
4. lambda$canHandle$0 : replaced boolean return with false for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$canHandle$0 → NO_COVERAGE
|
.anyMatch((cch) -> cch.canHandle(this, combinationPolicy, chromosome)); |
29
|
|
|
30
|
|
} |
31
|
|
|
32
|
|
public ChromosomeCombinator<T> resolve(final CombinationPolicy combinationPolicy, final ChromosomeSpec chromosome) { |
33
|
|
Validate.notNull(combinationPolicy); |
34
|
|
Validate.notNull(chromosome); |
35
|
|
|
36
|
2
1. resolve : replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::resolve → KILLED
2. resolve : removed call to java/util/List::stream → KILLED
|
return chromosomeCombinatorHandlers.stream() |
37
|
9
1. lambda$resolve$1 : Substituted 1 with 0 → KILLED
2. resolve : removed call to java/util/stream/Stream::dropWhile → KILLED
3. resolve : replaced call to java/util/stream/Stream::dropWhile with receiver → KILLED
4. lambda$resolve$1 : negated conditional → KILLED
5. lambda$resolve$1 : removed conditional - replaced equality check with true → KILLED
6. lambda$resolve$1 : removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::canHandle → KILLED
7. lambda$resolve$1 : replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$1 → KILLED
8. lambda$resolve$1 : Substituted 0 with 1 → KILLED
9. lambda$resolve$1 : removed conditional - replaced equality check with false → KILLED
|
.dropWhile((cch) -> cch.canHandle(this, combinationPolicy, chromosome) == false) |
38
|
1
1. resolve : removed call to java/util/stream/Stream::findFirst → KILLED
|
.findFirst() |
39
|
4
1. lambda$resolve$2 : removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::resolve → KILLED
2. resolve : replaced call to java/util/Optional::map with receiver → KILLED
3. lambda$resolve$2 : replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$2 → KILLED
4. resolve : removed call to java/util/Optional::map → KILLED
|
.map((cch) -> cch.resolve(this, combinationPolicy, chromosome)) |
40
|
5
1. lambda$resolve$3 : replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$3 → NO_COVERAGE
2. lambda$resolve$3 : removed call to java/lang/String::valueOf → NO_COVERAGE
3. lambda$resolve$3 : removed call to java/lang/String::valueOf → NO_COVERAGE
4. lambda$resolve$3 : removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
5. resolve : removed call to java/util/Optional::orElseThrow → KILLED
|
.orElseThrow(() -> new IllegalStateException( |
41
|
|
"Could not find suitable chromosome combination policy handler for policy " + combinationPolicy |
42
|
|
+ " and chromosome " + chromosome)); |
43
|
|
} |
44
|
|
} |
| | Mutations |
19 |
|
1.1 Location : <init> Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] Removed assignment to member variable eaExecutionContext → KILLED
|
20 |
|
1.1 Location : <init> Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to net/bmahe/genetics4j/core/spec/AbstractEAExecutionContext::chromosomeCombinatorHandlers → KILLED
2.2 Location : <init> Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] Removed assignment to member variable chromosomeCombinatorHandlers → KILLED
|
27 |
|
1.1 Location : canHandle Killed by : none removed call to java/util/List::stream → NO_COVERAGE
2.2 Location : canHandle Killed by : none replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::canHandle → NO_COVERAGE
3.3 Location : canHandle Killed by : none replaced boolean return with false for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::canHandle → NO_COVERAGE
|
28 |
|
1.1 Location : canHandle Killed by : none removed call to java/util/stream/Stream::anyMatch → NO_COVERAGE
2.2 Location : lambda$canHandle$0 Killed by : none removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::canHandle → NO_COVERAGE
3.3 Location : lambda$canHandle$0 Killed by : none replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$canHandle$0 → NO_COVERAGE
4.4 Location : lambda$canHandle$0 Killed by : none replaced boolean return with false for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$canHandle$0 → NO_COVERAGE
|
36 |
|
1.1 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithPostEvaluationProcessor()] replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::resolve → KILLED
2.2 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/List::stream → KILLED
|
37 |
|
1.1 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] Substituted 1 with 0 → KILLED
2.2 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/stream/Stream::dropWhile → KILLED
3.3 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced call to java/util/stream/Stream::dropWhile with receiver → KILLED
4.4 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] negated conditional → KILLED
5.5 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed conditional - replaced equality check with true → KILLED
6.6 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::canHandle → KILLED
7.7 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced boolean return with true for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$1 → KILLED
8.8 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] Substituted 0 with 1 → KILLED
9.9 Location : lambda$resolve$1 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed conditional - replaced equality check with false → KILLED
|
38 |
|
1.1 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/stream/Stream::findFirst → KILLED
|
39 |
|
1.1 Location : lambda$resolve$2 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to net/bmahe/genetics4j/core/combination/ChromosomeCombinatorHandler::resolve → KILLED
2.2 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced call to java/util/Optional::map with receiver → KILLED
3.3 Location : lambda$resolve$2 Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$2 → KILLED
4.4 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testGetterMethods()] removed call to java/util/Optional::map → KILLED
|
40 |
|
1.1 Location : lambda$resolve$3 Killed by : none replaced return value with null for net/bmahe/genetics4j/core/combination/ChromosomeCombinatorResolver::lambda$resolve$3 → NO_COVERAGE
2.2 Location : lambda$resolve$3 Killed by : none removed call to java/lang/String::valueOf → NO_COVERAGE
3.3 Location : lambda$resolve$3 Killed by : none removed call to java/lang/String::valueOf → NO_COVERAGE
4.4 Location : resolve Killed by : net.bmahe.genetics4j.core.EASystemTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.EASystemTest]/[method:testEvolveWithPostEvaluationProcessor()] removed call to java/util/Optional::orElseThrow → KILLED
5.5 Location : lambda$resolve$3 Killed by : none removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
|