Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

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

public class RelativeRangeMutator
extends DoubleMutator

Mutation of a double number with a mutation range. This operator will add a random double 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.
 double mutate(double value)
          Mutates a double value.
 void setRange(float f)
          Sets a new mutation range.
 
Methods inherited from class org.evolvica.core.mutate.Double.DoubleMutator
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 double mutate(double value)
Description copied from class: DoubleMutator
Mutates a double value.

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

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