Package org.opt4j.operator.neighbor
Class NeighborPermutationInsert
- java.lang.Object
-
- org.opt4j.operator.neighbor.NeighborPermutationInsert
-
- All Implemented Interfaces:
Operator<PermutationGenotype<?>>,Neighbor<PermutationGenotype<?>>,NeighborPermutation
public class NeighborPermutationInsert extends Object implements NeighborPermutation
Neighbor for the
PermutationGenotype. One element is moved to a different position.Given a permutation
1 2 3 4 5 6 7 8, this might result in1 2 6 3 4 5 7 8.
-
-
Constructor Summary
Constructors Constructor Description NeighborPermutationInsert(Rand random)Constructs aNeighborPermutationInsertoperator 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
-
-
Constructor Detail
-
NeighborPermutationInsert
@Inject public NeighborPermutationInsert(Rand random)
Constructs aNeighborPermutationInsertoperator for thePermutationGenotype.- Parameters:
random- 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
-
-