Class NeighborPermutationInsert

  • All Implemented Interfaces:
    org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.PermutationGenotype<?>>, Neighbor<org.opt4j.core.genotype.PermutationGenotype<?>>, NeighborPermutation

    public class NeighborPermutationInsert
    extends java.lang.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 in 1 2 6 3 4 5 7 8.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Random random  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void neighbor​(org.opt4j.core.genotype.PermutationGenotype<?> genotype)
      Moves the Genotype to a neighbor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • random

        protected final java.util.Random random
    • Constructor Detail

      • NeighborPermutationInsert

        @Inject
        public NeighborPermutationInsert​(org.opt4j.core.common.random.Rand random)
        Constructs a NeighborPermutationInsert operator for the PermutationGenotype.
        Parameters:
        random - the random number generator
    • Method Detail

      • neighbor

        public void neighbor​(org.opt4j.core.genotype.PermutationGenotype<?> genotype)
        Description copied from interface: Neighbor
        Moves the Genotype to a neighbor.
        Specified by:
        neighbor in interface Neighbor<org.opt4j.core.genotype.PermutationGenotype<?>>
        Parameters:
        genotype - the Genotype to be changed