S
- type of the solution.public final class SexualReproductionPipeline<S extends Solution<?>>
extends java.lang.Object
Pipeline for processing parent agents in standard way.
Supported operations: * recombination, * mutation, * improvement, * energy transfer, * evaluation.
Pipeline is immutable, new instance is created with each call.
Modifier and Type | Field and Description |
---|---|
private @Nullable EmasAgent |
child |
private S |
childSolution |
private EmasAgent |
firstParent |
private S |
firstSolution |
private EmasAgent |
secondParent |
private S |
secondSolution |
Modifier | Constructor and Description |
---|---|
private |
SexualReproductionPipeline(EmasAgent firstParent,
EmasAgent secondParent) |
private |
SexualReproductionPipeline(EmasAgent firstParent,
EmasAgent secondParent,
EmasAgent child) |
private |
SexualReproductionPipeline(EmasAgent firstParent,
EmasAgent secondParent,
@Nullable EmasAgent child,
S childSolution) |
private |
SexualReproductionPipeline(EmasAgent firstParent,
EmasAgent secondParent,
S childSolution) |
Modifier and Type | Method and Description |
---|---|
io.vavr.Tuple2<io.vavr.collection.Seq<EmasAgent>,EmasAgent> |
extract()
Extracts agents from this pipeline.
|
SexualReproductionPipeline<S> |
mutate(Mutation<S> mutation) |
static <S extends Solution<?>> |
on(EmasAgent firstParent,
EmasAgent secondParent)
Create a pipeline for two given parents.
|
SexualReproductionPipeline<S> |
recombine(Recombination<S> recombination) |
SexualReproductionPipeline<S> |
transferEnergy(EnergyTransfer energyTransfer) |
private final EmasAgent firstParent
private final EmasAgent secondParent
private final @Nullable EmasAgent child
private SexualReproductionPipeline(EmasAgent firstParent, EmasAgent secondParent)
private SexualReproductionPipeline(EmasAgent firstParent, EmasAgent secondParent, S childSolution)
private SexualReproductionPipeline(EmasAgent firstParent, EmasAgent secondParent, EmasAgent child)
public static <S extends Solution<?>> SexualReproductionPipeline<S> on(EmasAgent firstParent, EmasAgent secondParent)
Create a pipeline for two given parents.
S
- type of the solutionfirstParent
- secondParent
- public SexualReproductionPipeline<S> recombine(Recombination<S> recombination)
public SexualReproductionPipeline<S> mutate(Mutation<S> mutation)
public SexualReproductionPipeline<S> transferEnergy(EnergyTransfer energyTransfer)