| 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 AddConnection 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 AddNodeMutation} instance. | |
| 21 | * | |
| 22 | * @param populationMutationProbability The value for the {@code populationMutationProbability} attribute | |
| 23 | * @return An immutable AddNodeMutation instance | |
| 24 | */ | |
| 25 | public static AddConnection of(final double populationMutationProbability) { | |
| 26 |
2
1. of : removed call to net/bmahe/genetics4j/neat/spec/mutation/ImmutableAddConnection::of → KILLED 2. of : replaced return value with null for net/bmahe/genetics4j/neat/spec/mutation/AddConnection::of → KILLED |
return ImmutableAddConnection.of(populationMutationProbability); |
| 27 | } | |
| 28 | ||
| 29 | } | |
Mutations | ||
| 26 |
1.1 2.2 |