eaLib API Docs
Last Modified : January 7 2002

mss.ea.mut
Class SwapListMutation

java.lang.Object
  |
  +--mss.ea.core.GeneticOperator
        |
        +--mss.ea.mut.Mutation
              |
              +--mss.ea.mut.ChromosomeMutation
                    |
                    +--mss.ea.mut.ListMutation
                          |
                          +--mss.ea.mut.SwapListMutation

public class SwapListMutation
extends ListMutation

Swap mutation of an array. This operator will randomly swap two elements of a list.

Since:
0.1
Version:
0.1 (06-13-2001)
Author:
Andreas Rummler

Fields inherited from class mss.ea.mut.ListMutation
rand
 
Fields inherited from class mss.ea.mut.ChromosomeMutation
mutationPropability
 
Fields inherited from class mss.ea.core.GeneticOperator
description, ID, name
 
Constructor Summary
SwapListMutation()
          Constructor.
SwapListMutation(float propability)
          Constructor with mutation propability.
 
Method Summary
 void mutate(ListChromosome cr)
          Performs the mutation.
protected  void swap(java.util.List co)
          Swaps two randomly selected objects in an array.
 
Methods inherited from class mss.ea.mut.ListMutation
mutate
 
Methods inherited from class mss.ea.core.GeneticOperator
getDescription, getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwapListMutation

public SwapListMutation()
Constructor. The mutation propability is set to 0.05.

SwapListMutation

public SwapListMutation(float propability)
Constructor with mutation propability.
Parameters:
propability - mutation propability
Method Detail

mutate

public void mutate(ListChromosome cr)
            throws MutationException
Performs the mutation.
Overrides:
mutate in class ListMutation
Parameters:
cr - list chromosome
Throws:
MutationException - thrown, if operator fails

swap

protected void swap(java.util.List co)
Swaps two randomly selected objects in an array.
Parameters:
co - array to do the swapping with

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS