net.sourceforge.cilib.functions
Class DiscreteFunction

java.lang.Object
  extended by net.sourceforge.cilib.functions.Function
      extended by net.sourceforge.cilib.functions.DiscreteFunction
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
BinaryAdapter, BitStringMatcher, KnapSack, KnightsCoverage, KnightsTour, LongestCommonSubsequence, Queens

public abstract class DiscreteFunction
extends Function

Author:
Gary Pampara
See Also:
Serialized Form

Constructor Summary
protected DiscreteFunction()
          Create an instance of DiscreteFunction.
 
Method Summary
 Double evaluate(Type x)
          Each function must provide an implementation which returns the function value at the given position.
abstract  double evaluate(Vector x)
          Evaluate the function output, given the function input, x.
 Object getMaximum()
          Accessor for the function maximum.
 Object getMinimum()
          Accessor for the function minimum.
 
Methods inherited from class net.sourceforge.cilib.functions.Function
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry, setDomain
 
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

DiscreteFunction

protected DiscreteFunction()
Create an instance of DiscreteFunction.

Method Detail

getMinimum

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

Specified by:
getMinimum in class Function
Returns:
The minimum function value.

getMaximum

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

Specified by:
getMaximum in class Function
Returns:
The maximum of the function.

evaluate

public 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.

Specified by:
evaluate in class Function
Parameters:
x - the position
Returns:
The result of the evaluation.

evaluate

public abstract double evaluate(Vector x)
Evaluate the function output, given the function input, x.

Parameters:
x - The Vector representing the function input.
Returns:
The result of the evaluation.


Copyright © 2009 CIRG. All Rights Reserved.