1 | package net.bmahe.genetics4j.neat.spec.mutation; | |
2 | ||
3 | import org.apache.commons.lang3.Validate; | |
4 | import org.immutables.value.Value; | |
5 | ||
6 | import net.bmahe.genetics4j.core.spec.mutation.MutationPolicy; | |
7 | ||
8 | @Value.Immutable | |
9 | public abstract class SwitchStateMutation implements MutationPolicy { | |
10 | ||
11 | @Value.Parameter | |
12 | public abstract double populationMutationProbability(); | |
13 | ||
14 | @Value.Check | |
15 | protected void check() { | |
16 | Validate.inclusiveBetween(0.0, 1.0, populationMutationProbability()); | |
17 | } | |
18 | ||
19 | /** | |
20 | * Construct a new immutable {@code SwitchStateMutation} instance. | |
21 | * | |
22 | * @param populationMutationProbability The value for the | |
23 | * {@code populationMutationProbability} | |
24 | * attribute | |
25 | * @return An immutable SwitchStateMutation instance | |
26 | */ | |
27 | public static SwitchStateMutation of(final double populationMutationProbability) { | |
28 |
2
1. of : removed call to net/bmahe/genetics4j/neat/spec/mutation/ImmutableSwitchStateMutation::of → KILLED 2. of : replaced return value with null for net/bmahe/genetics4j/neat/spec/mutation/SwitchStateMutation::of → KILLED |
return ImmutableSwitchStateMutation.of(populationMutationProbability); |
29 | } | |
30 | } | |
Mutations | ||
28 |
1.1 2.2 |