net.sourceforge.cilib.problem
Class FunctionOptimisationProblem

java.lang.Object
  extended by net.sourceforge.cilib.problem.OptimisationProblemAdapter
      extended by net.sourceforge.cilib.problem.FunctionOptimisationProblem
All Implemented Interfaces:
Serializable, OptimisationProblem, Problem, Cloneable
Direct Known Subclasses:
FunctionMaximisationProblem, FunctionMinimisationProblem

public abstract class FunctionOptimisationProblem
extends OptimisationProblemAdapter

This class serves as a base class for function optimisation problems using a Function.

Author:
Edwin Peer
See Also:
Serialized Form

Field Summary
protected  Function function
           
 
Fields inherited from class net.sourceforge.cilib.problem.OptimisationProblemAdapter
dataSetBuilder, fitnessEvaluations
 
Constructor Summary
FunctionOptimisationProblem()
          Creates a new instance of FunctionOptimisationProblem with null function.
FunctionOptimisationProblem(FunctionOptimisationProblem copy)
          Create a copy of the provided instance.
 
Method Summary
 void accept(ProblemVisitor visitor)
          Accept the provided Visitor and perform the Visitor.visit(Object) method.
 DomainRegistry getBehaviouralDomain()
          Returns the domain component that describes the search space of the needed behavioral characteristics of the problem.
abstract  FunctionOptimisationProblem getClone()
          Create a cloned copy of the current object and return it.
 DomainRegistry getDomain()
          Returns the component that describes the domain of the function.
abstract  double getError(Type solution)
          Returns the error (as a double for now) that the given solution has with respect to the actual optimum solution.
 Function getFunction()
          Accessor for the function that is to be optimised.
 void setFunction(Function function)
          Sets the function that is to be optimised.
 
Methods inherited from class net.sourceforge.cilib.problem.OptimisationProblemAdapter
calculateFitness, changeEnvironment, getChangeStrategy, getDataSetBuilder, getFitness, getFitnessEvaluations, setChangeStrategy, setDataSetBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

protected Function function
Constructor Detail

FunctionOptimisationProblem

public FunctionOptimisationProblem()
Creates a new instance of FunctionOptimisationProblem with null function. Remember to always set a Function before attempting to apply an algorithm to this problem.

See Also:
#setFunction(net.sourceforge.cilib.Functions.Function)

FunctionOptimisationProblem

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

Parameters:
copy - The instance to copy.
Method Detail

getClone

public abstract FunctionOptimisationProblem getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface OptimisationProblem
Specified by:
getClone in interface Problem
Specified by:
getClone in interface Cloneable
Specified by:
getClone in class OptimisationProblemAdapter
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

setFunction

public void setFunction(Function function)
Sets the function that is to be optimised.

Parameters:
function - The function.

getFunction

public Function getFunction()
Accessor for the function that is to be optimised.

Returns:
The function

getDomain

public DomainRegistry getDomain()
Returns the component that describes the domain of the function.

Returns:
the domain component.

getBehaviouralDomain

public DomainRegistry getBehaviouralDomain()
Description copied from interface: OptimisationProblem
Returns the domain component that describes the search space of the needed behavioral characteristics of the problem. This is mainly used for ECs, however, the use of behavioral parameters with PSO will be investigated.

Returns:
The domain of the behavioral component

getError

public abstract double getError(Type solution)
Returns the error (as a double for now) that the given solution has with respect to the actual optimum solution.

Parameters:
solution - the solution for which an error should be determined
Returns:
the error with respect to the optimum solution

accept

public void accept(ProblemVisitor visitor)
Description copied from class: OptimisationProblemAdapter
Accept the provided Visitor and perform the Visitor.visit(Object) method.

Specified by:
accept in interface OptimisationProblem
Overrides:
accept in class OptimisationProblemAdapter
Parameters:
visitor - The visitor which has operations to perform.


Copyright © 2009 CIRG. All Rights Reserved.