Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.mutate.Float
Class RelativeRangeMutator

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.Float.FloatMutator
                  extended byorg.evolvica.core.mutate.Float.RelativeRangeMutator
All Implemented Interfaces:
IGeneticOperator, IOperator, IProcessor, java.io.Serializable

public class RelativeRangeMutator
extends FloatMutator

Mutation of a float number with a mutation range. This operator will add a random float number within the given range relative to the given value.
The mutated value = value + random( - value * range, + value * range ), range in percent

Since:
0.4.0
Version:
$Revision: 1.6 $ $Date: 2004/05/26 11:58:07 $
Author:
Andreas Rummler
See Also:
Serialized Form

Field Summary
protected  float range
          Mutation range.
 
Fields inherited from class org.evolvica.core.mutate.AbstractMutator
propability
 
Fields inherited from class org.evolvica.engine.AbstractOperator
descriptor, element, id, name
 
Constructor Summary
RelativeRangeMutator()
          Constructor.
RelativeRangeMutator(float range)
          Constructor with mutation range.
 
Method Summary
 float getRange()
          Returns the mutation range.
 float mutate(float value)
          Mutates a float value.
 void setRange(float f)
          Sets a new mutation range.
 
Methods inherited from class org.evolvica.core.mutate.Float.FloatMutator
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

range

protected float range
Mutation range.

Constructor Detail

RelativeRangeMutator

public RelativeRangeMutator()
Constructor. The mutation range is set to 10%.


RelativeRangeMutator

public RelativeRangeMutator(float range)
Constructor with mutation range.

Parameters:
range - mutation range
Method Detail

mutate

public float mutate(float value)
Description copied from class: FloatMutator
Mutates a float value.

Specified by:
mutate in class FloatMutator
Parameters:
value - the value to be mutated
Returns:
the mutated value
See Also:
FloatMutator.mutate(float)

getRange

public float getRange()
Returns the mutation range.

Returns:
the mutation range

setRange

public void setRange(float f)
Sets a new mutation range.

Parameters:
f - new value for the mutation range

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

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