net.sourceforge.cilib.controlparameter
Class RandomizingControlParameter

java.lang.Object
  extended by net.sourceforge.cilib.controlparameter.RandomizingControlParameter
All Implemented Interfaces:
Serializable, ControlParameter, Cloneable

public class RandomizingControlParameter
extends Object
implements ControlParameter

A control parameter that is defined to return a constant multiplied with a random number.

This class defined the required functionality for the AccelerationComponent within a VelocityUpdate.

Author:
Gary Pampara, Andries Engelbrecht
See Also:
Serialized Form

Field Summary
protected  ControlParameter controlParameter
           
protected  Random randomiser
           
 
Constructor Summary
RandomizingControlParameter()
          Create a new RandomizingControlParameter instance.
RandomizingControlParameter(RandomizingControlParameter copy)
          Copy constructor.
 
Method Summary
 RandomizingControlParameter getClone()
          Clone the current object such that a comparison of the clone and original object will yield two separate, but duplicate objects.
 ControlParameter getControlParameter()
          Get the currently used ControlParameterUpdateStrategy.
 double getParameter()
          Get the value of this parameter after it has been multiplied with a uniform random number.
 double getParameter(double min, double max)
          Get the parameter value based on the provided min and max.
 Random getRandomiser()
          Return the current Random.
 void setControlParameter(ControlParameter controlParameter)
          Set the ControlParameterUpdateStrategy to be used.
 void setParameter(double value)
          Set the value of the parameter in the underlying ControlParameterUpdateStrategy.
 void setRandomiser(Random randomiser)
          Set the Random to be used.
 void updateParameter()
          Update the contained ControlParameterUpdateStrategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlParameter

protected ControlParameter controlParameter

randomiser

protected Random randomiser
Constructor Detail

RandomizingControlParameter

public RandomizingControlParameter()
Create a new RandomizingControlParameter instance. This object will be instantiated by default with a contained ControlParameter and a MersenneTwister as the random number generator.


RandomizingControlParameter

public RandomizingControlParameter(RandomizingControlParameter copy)
Copy constructor.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public RandomizingControlParameter getClone()
Clone the current object such that a comparison of the clone and original object will yield two separate, but duplicate objects.

Specified by:
getClone in interface ControlParameter
Specified by:
getClone in interface Cloneable
Returns:
The cloned ControlParameter
See Also:
Object.clone()

getRandomiser

public Random getRandomiser()
Return the current Random.

Returns:
The Random being used.

setRandomiser

public void setRandomiser(Random randomiser)
Set the Random to be used.

Parameters:
randomiser - The Random to be used.

getControlParameter

public ControlParameter getControlParameter()
Get the currently used ControlParameterUpdateStrategy.

Returns:
The used ControlParameterUpdateStrategy

setControlParameter

public void setControlParameter(ControlParameter controlParameter)
Set the ControlParameterUpdateStrategy to be used.

Parameters:
controlParameter - The ControlParameterUpdateStrategy to be used.

getParameter

public double getParameter()
Get the value of this parameter after it has been multiplied with a uniform random number.

Specified by:
getParameter in interface ControlParameter
Returns:
The value representing a uniform random number multiplied by the value of the underlying ControlParameterUpdateStrategy.

getParameter

public double getParameter(double min,
                           double max)
Get the parameter value based on the provided min and max.

Specified by:
getParameter in interface ControlParameter
Parameters:
min - The minimum value to use in getting the parameter value
max - The maximum value to use in getting the parameter value
Returns:
The value of the represented parameter.

setParameter

public void setParameter(double value)
Set the value of the parameter in the underlying ControlParameterUpdateStrategy.

Specified by:
setParameter in interface ControlParameter
Parameters:
value - The value to have the parameter set to,

updateParameter

public void updateParameter()
Update the contained ControlParameterUpdateStrategy.

Specified by:
updateParameter in interface ControlParameter


Copyright © 2009 CIRG. All Rights Reserved.