net.sourceforge.cilib.controlparameter
Class BoundedControlParameter

java.lang.Object
  extended by net.sourceforge.cilib.controlparameter.BoundedControlParameter
All Implemented Interfaces:
Serializable, ControlParameter, Cloneable
Direct Known Subclasses:
ExponentiallyDecreasingControlParameter, ExponentiallyIncreasingControlParameter, LinearDecreasingControlParameter, LinearIncreasingControlParameter

public abstract class BoundedControlParameter
extends Object
implements ControlParameter

A control parameter instance that is defined to operate within a specific range of values. The range is defined as a domain string. Any time the parameter exceeds the bounded range, it will be clamped and brought back to remain on the edges of the range specified.

Author:
Gary Pampara
See Also:
Serialized Form

Field Summary
protected  Real parameter
           
protected  String range
           
 
Constructor Summary
BoundedControlParameter()
          Create an instance of the BoundedControlParameter.
BoundedControlParameter(BoundedControlParameter copy)
          Create a copy of the provided instance.
 
Method Summary
protected  void clamp()
          Clamp the current paramter vaue between the lower and upper bound values.
abstract  BoundedControlParameter getClone()
          Clone the current object such that a comparison of the clone and original object will yield two separate, but duplicate objects.
 double getLowerBound()
          Get the lower bound of the control paramter.
 double getParameter()
          Get the value of the represented parameter.
 double getParameter(double min, double max)
          Get the parameter value based on the provided min and max.
 String getRange()
          Get the range of the BoundedControlParameter.
 double getUpperBound()
          Get the upper bound for the control parameter.
 void setLowerBound(double lower)
          Set the value of the lower bound.
 void setParameter(double value)
          Set the value of the represented parameter.
 void setRange(String range)
          Set the range of the parameter.
 void setUpperBound(double value)
          Set the value for the upper bound.
protected abstract  void update()
          Update the paramter.
 void updateParameter()
          Update the required and needed parameters contained within this parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameter

protected Real parameter

range

protected String range
Constructor Detail

BoundedControlParameter

public BoundedControlParameter()
Create an instance of the BoundedControlParameter.


BoundedControlParameter

public BoundedControlParameter(BoundedControlParameter copy)
Create a copy of the provided instance.

Parameters:
copy - The instance which to copy.
Method Detail

getClone

public abstract BoundedControlParameter 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()

getParameter

public double getParameter()
Get the value of the represented parameter.

Specified by:
getParameter in interface ControlParameter
Returns:
The value of the represented parameter.

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 represented parameter.

Specified by:
setParameter in interface ControlParameter
Parameters:
value - The value to be used.

updateParameter

public void updateParameter()
Update the required and needed parameters contained within this parameter.

Specified by:
updateParameter in interface ControlParameter

update

protected abstract void update()
Update the paramter.


clamp

protected void clamp()
Clamp the current paramter vaue between the lower and upper bound values.


getLowerBound

public double getLowerBound()
Get the lower bound of the control paramter.

Returns:
The lower bound value.

setLowerBound

public void setLowerBound(double lower)
Set the value of the lower bound.

Parameters:
lower - The value to set.

getUpperBound

public double getUpperBound()
Get the upper bound for the control parameter.

Returns:
The upper bound value.

setUpperBound

public void setUpperBound(double value)
Set the value for the upper bound.

Parameters:
value - The value to set.

getRange

public String getRange()
Get the range of the BoundedControlParameter.

Returns:
The string representing the range of the parameter.

setRange

public void setRange(String range)
              throws ParseException
Set the range of the parameter.

Parameters:
range - The domain string representing the range.
Throws:
ParseException


Copyright © 2009 CIRG. All Rights Reserved.