mss.ea.mut
Class SwapArrayMutation
java.lang.Object
|
+--mss.ea.core.GeneticOperator
|
+--mss.ea.mut.Mutation
|
+--mss.ea.mut.ChromosomeMutation
|
+--mss.ea.mut.ArrayMutation
|
+--mss.ea.mut.SwapArrayMutation
- public class SwapArrayMutation
- extends ArrayMutation
Swap mutation of an array.
This operator will randomly swap two elements of an array.
- Since:
- 0.1
- Version:
- 0.1 (06-14-2001)
- Author:
- Andreas Rummler
Method Summary |
void |
mutate(ArrayChromosome cr)
Performs the mutation. |
protected void |
swap(java.lang.Object co)
Swaps two randomly selected objects in an array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SwapArrayMutation
public SwapArrayMutation()
- Constructor.
The mutation propability is set to 0.05.
SwapArrayMutation
public SwapArrayMutation(float propability)
- Constructor with mutation propability.
- Parameters:
propability
- mutation propability
mutate
public void mutate(ArrayChromosome cr)
throws MutationException
- Performs the mutation.
- Overrides:
mutate
in class ArrayMutation
- Parameters:
cr
- chromosome of type array- Throws:
MutationException
- thrown, if operator fails
swap
protected void swap(java.lang.Object co)
- Swaps two randomly selected objects in an array.
- Parameters:
co
- array to do the swapping with
Copyright © 2000-2001 Technical University of Ilmenau, Department ESS