Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.mutate.iarray
Class ShiftMutator

java.lang.Object
  extended byorg.evolvica.engine.AbstractOperator
      extended byorg.evolvica.core.common.AbstractGeneticOperator
          extended byorg.evolvica.core.mutate.AbstractMutator
              extended byorg.evolvica.core.mutate.iarray.IntegerArrayMutator
                  extended byorg.evolvica.core.mutate.iarray.ShiftMutator
All Implemented Interfaces:
IGeneticOperator, IOperator, IProcessor, java.io.Serializable

public class ShiftMutator
extends IntegerArrayMutator

Shift mutation of an integer 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.4.0
Version:
$Revision: 1.8 $ $Date: 2004/05/26 11:58:10 $
Author:
Andreas Rummler
See Also:
Serialized Form

Field Summary
protected  int[] clipArray
          Array of clipped elements.
protected  int clipNumber
          Number of clipped elements.
protected  float clipPercentage
          Number of clipped elements (percentage).
 
Fields inherited from class org.evolvica.core.mutate.AbstractMutator
propability
 
Fields inherited from class org.evolvica.engine.AbstractOperator
descriptor, element, id, name
 
Constructor Summary
ShiftMutator()
          Constructor.
ShiftMutator(float percentage)
          Constructor with number of clipped elements.
ShiftMutator(int number)
          Constructor with number of clipped elements.
 
Method Summary
 int[] mutate(int[] array)
          Mutates an integer array.
protected  int[] setupClipArray(int[] array, int arrayLength)
          Set up the clip array
 
Methods inherited from class org.evolvica.core.mutate.iarray.IntegerArrayMutator
mutate
 
Methods inherited from class org.evolvica.core.mutate.AbstractMutator
getPropability, process, setPropability
 
Methods inherited from class org.evolvica.engine.AbstractOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.evolvica.engine.IOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 

Field Detail

clipNumber

protected int clipNumber
Number of clipped elements.


clipPercentage

protected float clipPercentage
Number of clipped elements (percentage).


clipArray

protected int[] clipArray
Array of clipped elements.

Constructor Detail

ShiftMutator

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


ShiftMutator

public ShiftMutator(float percentage)
Constructor with number of clipped elements.

Parameters:
percentage - percentage value of the number of elements to be clipped

ShiftMutator

public ShiftMutator(int number)
Constructor with number of clipped elements.

Parameters:
number - number of elements to be clipped
Method Detail

mutate

public int[] mutate(int[] array)
Description copied from class: IntegerArrayMutator
Mutates an integer array.

Specified by:
mutate in class IntegerArrayMutator
Parameters:
array - integer array to be mutated
Returns:
mutated integer array
See Also:
IntegerArrayMutator.mutate(int[])

setupClipArray

protected int[] setupClipArray(int[] array,
                               int arrayLength)
Set up the clip array

Parameters:
array - clip array
arrayLength - clip length
Returns:
clipped array

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems