Package org.opt4j.operators.neighbor
Class NeighborPermutationMixed
- java.lang.Object
-
- org.opt4j.operators.neighbor.NeighborPermutationMixed
-
- All Implemented Interfaces:
org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.PermutationGenotype<?>>
,Neighbor<org.opt4j.core.genotype.PermutationGenotype<?>>
,NeighborPermutation
public class NeighborPermutationMixed extends java.lang.Object implements NeighborPermutation
Randomly selects between
NeighborPermutationSwap
,NeighborPermutationInsert
, andNeighborPermutationRevert
.
-
-
Field Summary
Fields Modifier and Type Field Description protected NeighborPermutationInsert
insert
protected java.util.Random
random
protected NeighborPermutationRevert
revert
protected NeighborPermutationSwap
swap
-
Constructor Summary
Constructors Constructor Description NeighborPermutationMixed(NeighborPermutationSwap swap, NeighborPermutationInsert insert, NeighborPermutationRevert revert, org.opt4j.core.common.random.Rand random)
Constructs aNeighborPermutationMixed
operator for thePermutationGenotype
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
neighbor(org.opt4j.core.genotype.PermutationGenotype<?> genotype)
Moves theGenotype
to a neighbor.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opt4j.operators.neighbor.Neighbor
getOperatorType
-
-
-
-
Field Detail
-
random
protected final java.util.Random random
-
swap
protected final NeighborPermutationSwap swap
-
insert
protected final NeighborPermutationInsert insert
-
revert
protected final NeighborPermutationRevert revert
-
-
Constructor Detail
-
NeighborPermutationMixed
@Inject public NeighborPermutationMixed(NeighborPermutationSwap swap, NeighborPermutationInsert insert, NeighborPermutationRevert revert, org.opt4j.core.common.random.Rand random)
Constructs aNeighborPermutationMixed
operator for thePermutationGenotype
.- Parameters:
swap
- the swap permutationinsert
- the insert permutationrevert
- the revert permutationrandom
- the random number generator
-
-
Method Detail
-
neighbor
public void neighbor(org.opt4j.core.genotype.PermutationGenotype<?> genotype)
Description copied from interface:Neighbor
Moves theGenotype
to a neighbor.
-
-