de.unidu.is.util
Class Function

java.lang.Object
  extended byde.unidu.is.util.Function
Direct Known Subclasses:
LearnableFunction

public abstract class Function
extends java.lang.Object

The abstract super-class of (parametrisable) functions.

Since:
2004-06-21
Version:
$Revision: 1.7 $, $Date: 2005/02/21 17:29:29 $
Author:
Henrik Nottelmann

Field Summary
protected  PropertyMap parameters
          Parameters of this function (stored as doubles).
 
Constructor Summary
Function()
           
 
Method Summary
abstract  double apply(double x)
          Apply the value x onto the function, and return the function value.
 double getParameter(java.lang.String name)
          Returns the value of the specified parameter.
abstract  java.lang.String[] getParameterNames()
          Returns the parameter names.
 PropertyMap getParameters()
          Returns all parameters.
 void init(PropertyMap values)
          Initialises the function with the specified values.
 void setParameters(PropertyMap map)
          Sets the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

protected PropertyMap parameters
Parameters of this function (stored as doubles).

Constructor Detail

Function

public Function()
Method Detail

apply

public abstract double apply(double x)
Apply the value x onto the function, and return the function value.

Parameters:
x - value to apply
Returns:
result for x

getParameterNames

public abstract java.lang.String[] getParameterNames()
Returns the parameter names.

Returns:
parameter names

getParameters

public PropertyMap getParameters()
Returns all parameters.

Returns:
all parameters

setParameters

public void setParameters(PropertyMap map)
Sets the parameters.

Parameters:
map - function parameters

getParameter

public double getParameter(java.lang.String name)
Returns the value of the specified parameter.

Parameters:
name - parameter name
Returns:
parameter value (0 if parameter does not exist)

init

public void init(PropertyMap values)
Initialises the function with the specified values. This implementation does nothing. Subclasses can override this method e.g. for computing a parameter as the maximum value in the specified property map.

Parameters:
values - values for initialisation.