Package org.opt4j.operator.neighbor
Class NeighborPermutationMixed
- java.lang.Object
-
- org.opt4j.operator.neighbor.NeighborPermutationMixed
-
- All Implemented Interfaces:
Operator<PermutationGenotype<?>>,Neighbor<PermutationGenotype<?>>,NeighborPermutation
public class NeighborPermutationMixed extends Object implements NeighborPermutation
Randomly selects between
NeighborPermutationSwap,NeighborPermutationInsert, andNeighborPermutationRevert.
-
-
Field Summary
Fields Modifier and Type Field Description protected NeighborPermutationInsertinsertprotected Randomrandomprotected NeighborPermutationRevertrevertprotected NeighborPermutationSwapswap
-
Constructor Summary
Constructors Constructor Description NeighborPermutationMixed(NeighborPermutationSwap swap, NeighborPermutationInsert insert, NeighborPermutationRevert revert, Rand random)Constructs aNeighborPermutationMixedoperator for thePermutationGenotype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidneighbor(PermutationGenotype<?> genotype)Moves theGenotypeto a neighbor.
-
-
-
Field Detail
-
random
protected final 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, Rand random)
Constructs aNeighborPermutationMixedoperator for thePermutationGenotype.- Parameters:
swap- the swap permutationinsert- the insert permutationrevert- the revert permutationrandom- the random number generator
-
-
Method Detail
-
neighbor
public void neighbor(PermutationGenotype<?> genotype)
Description copied from interface:NeighborMoves theGenotypeto a neighbor.- Specified by:
neighborin interfaceNeighbor<PermutationGenotype<?>>- Parameters:
genotype- theGenotypeto be changed
-
-