es.udc.gii.common.eaf.plugin.parameter
Class RandomValue

java.lang.Object
  extended by es.udc.gii.common.eaf.plugin.parameter.Parameter
      extended by es.udc.gii.common.eaf.plugin.parameter.RandomValue
All Implemented Interfaces:
Configurable, Plugin

public class RandomValue
extends Parameter

A parameter that returns an evenly distributed random value between two given bounds.

Configuration:

 0
 1
 
LowerBound sets the lower bound of the range. If not given, -1 is assumed. UpperBound sets the upper bound of the range. If not given 1 is assumed.

Since:
1.0
Author:
Grupo Integrado de IngenierĂ­a (www.gii.udc.es)

Field Summary
private  double lowerBound
           
private  double upperBound
           
 
Constructor Summary
RandomValue()
          Default constructor.
RandomValue(double lowerBound, double upperBound)
          Constructs an instance of this class.
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
          Configures this class.
 double get(EvolutionaryAlgorithm algorithm)
           
 double getLowerBound()
           
 double getUpperBound()
           
 void setLowerBound(double lowerBound)
          Sets the lower bound of the range.
 void setUpperBound(double upperBound)
          Sets the upper bound of the range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lowerBound

private double lowerBound

upperBound

private double upperBound
Constructor Detail

RandomValue

public RandomValue(double lowerBound,
                   double upperBound)
Constructs an instance of this class.

Parameters:
lowerBound - Lower bound of the range.
upperBound - Upper bound of the range.

RandomValue

public RandomValue()
Default constructor. The range is set to [-1,1].

Method Detail

get

public double get(EvolutionaryAlgorithm algorithm)
Specified by:
get in class Parameter
Parameters:
algorithm - Current algorithm. Not used and hence can be set to null.
Returns:
An evenly distributed random value.

configure

public void configure(org.apache.commons.configuration.Configuration conf)
Configures this class.

Parameters:
conf -
See Also:
Configuration

getLowerBound

public double getLowerBound()
Returns:
The lower bound of the range.

setLowerBound

public void setLowerBound(double lowerBound)
Sets the lower bound of the range.

Parameters:
lowerBound - The new lower bound.

getUpperBound

public double getUpperBound()
Returns:
The upper bound of the range.

setUpperBound

public void setUpperBound(double upperBound)
Sets the upper bound of the range.

Parameters:
upperBound - The new upper bound.