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 NeighborPermutationInsert
insert
protected Random
random
protected NeighborPermutationRevert
revert
protected NeighborPermutationSwap
swap
-
Constructor Summary
Constructors Constructor Description NeighborPermutationMixed(NeighborPermutationSwap swap, NeighborPermutationInsert insert, NeighborPermutationRevert revert, Rand random)
Constructs aNeighborPermutationMixed
operator for thePermutationGenotype
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
neighbor(PermutationGenotype<?> genotype)
Moves theGenotype
to 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 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(PermutationGenotype<?> genotype)
Description copied from interface:Neighbor
Moves theGenotype
to a neighbor.- Specified by:
neighbor
in interfaceNeighbor<PermutationGenotype<?>>
- Parameters:
genotype
- theGenotype
to be changed
-
-