net.sourceforge.cilib.functions
Class Function

java.lang.Object
  extended by net.sourceforge.cilib.functions.Function
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ActivationFunction, ContinuousFunction, DiscreteFunction, NNFunctionAdapter

public abstract class Function
extends Object
implements Cloneable, Serializable

All functions should inherit from Function.

Author:
Edwin Peer, Gary Pampara
See Also:
Serialized Form

Constructor Summary
Function()
          Create a new instance of Function.
Function(Function copy)
          Create a copy of the provided instance.
 
Method Summary
abstract  Double evaluate(Type x)
          Each function must provide an implementation which returns the function value at the given position.
 DomainRegistry getBehavioralDomainRegistry()
           
 int getDimension()
           
 String getDomain()
           
 DomainRegistry getDomainRegistry()
          Accessor for the domain of the function.
abstract  Object getMaximum()
          Accessor for the function maximum.
abstract  Object getMinimum()
          Accessor for the function minimum.
 void setBehavioralDomain(String behavioralDomain)
          Set the behavioural domain of the Function.
 void setBehaviouralDomainRegistry(StringBasedDomainRegistry behavioralDomainRegistry)
           
 void setDomain(String representation)
          Sets the domain of the function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.cilib.util.Cloneable
getClone
 

Constructor Detail

Function

public Function()
Create a new instance of Function.


Function

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

Parameters:
copy - The instance to copy.
Method Detail

getDimension

public int getDimension()
Returns:
The dimension of the function.

getDomainRegistry

public DomainRegistry getDomainRegistry()
Accessor for the domain of the function. See net.sourceforge.cilib.Domain.Component.

Returns:
The function domain.

getBehavioralDomainRegistry

public DomainRegistry getBehavioralDomainRegistry()
Returns:
Returns the behaviouralDomainRegistry.

setBehaviouralDomainRegistry

public void setBehaviouralDomainRegistry(StringBasedDomainRegistry behavioralDomainRegistry)
Parameters:
behavioralDomainRegistry - The behaviouralDomainRegistry to set.

getDomain

public String getDomain()
Returns:
The domain String.

setDomain

public void setDomain(String representation)
Sets the domain of the function.

Parameters:
representation - the string representation for the function domain.

setBehavioralDomain

public void setBehavioralDomain(String behavioralDomain)
Set the behavioural domain of the Function.

Parameters:
behavioralDomain - The value to set.

getMinimum

public abstract Object getMinimum()
Accessor for the function minimum. This is the minimum value of the function in the given domain.

Returns:
The minimum function value.

getMaximum

public abstract Object getMaximum()
Accessor for the function maximum. This is the maximum value of the function in the given domain.

Returns:
The maximum of the function.

evaluate

public abstract Double evaluate(Type x)
Each function must provide an implementation which returns the function value at the given position. The length of the position array should be the same as the function dimension.

Parameters:
x - the position
Returns:
The result of the evaluation.


Copyright © 2009 CIRG. All Rights Reserved.