mss.ea.mut
Class ShiftArrayMutation
java.lang.Object
|
+--mss.ea.core.GeneticOperator
|
+--mss.ea.mut.Mutation
|
+--mss.ea.mut.ChromosomeMutation
|
+--mss.ea.mut.ArrayMutation
|
+--mss.ea.mut.ShiftArrayMutation
- public class ShiftArrayMutation
- extends ArrayMutation
Shift mutation of an array.
This operator will cut out random elements, shift the remaining elements upwards and append the elements,
that were clipped, to the end of the array.
- Since:
- 0.1.1
- Version:
- $Revision: 1.3 $ $Date: 2001/09/13 08:17:05 $
- Author:
- Andreas Rummler
Constructor Summary |
ShiftArrayMutation()
Constructor.
|
ShiftArrayMutation(float propability)
Constructor with mutation propability.
|
ShiftArrayMutation(float propability,
float percentage)
Constructor with mutation propability and number of clipped elements. |
ShiftArrayMutation(float propability,
int number)
Constructor with mutation propability and number of clipped elements. |
ShiftArrayMutation(float propability,
int[] array)
Constructor with mutation propability and indices of clipped elements.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
clipNumber
protected int clipNumber
clipPercentage
protected float clipPercentage
clipArray
protected int[] clipArray
ShiftArrayMutation
public ShiftArrayMutation()
- Constructor.
The mutation propability is set to 0.05.
ShiftArrayMutation
public ShiftArrayMutation(float propability)
- Constructor with mutation propability.
The number of clipped elements is randomly calculated.
- Parameters:
propability
- mutation propability
ShiftArrayMutation
public ShiftArrayMutation(float propability,
float percentage)
- Constructor with mutation propability and number of clipped elements.
- Parameters:
propability
- mutation propabilitypercentage
- percentage value of the number of elements to be clipped
ShiftArrayMutation
public ShiftArrayMutation(float propability,
int number)
- Constructor with mutation propability and number of clipped elements.
- Parameters:
propability
- mutation propabilitynumber
- number of elements to be clipped
ShiftArrayMutation
public ShiftArrayMutation(float propability,
int[] array)
- Constructor with mutation propability and indices of clipped elements.
This should only be used for debugging purposes.
- Parameters:
propability
- mutation propabilityarray
- array with indices of elements to be clipped
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
clipAndShift
protected void clipAndShift(java.lang.Object o)
setupClipArray
protected int[] setupClipArray(java.lang.Object o,
int arrayLength)
Copyright © 2000-2001 Technical University of Ilmenau, Department ESS