net.sourceforge.cilib.problem
Class FunctionMinimisationProblem

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

public class FunctionMinimisationProblem
extends FunctionOptimisationProblem

An implementation of OptimisationProblemAdapter that can be used to find the minimum of any Function.

Author:
Edwin Peer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.problem.FunctionOptimisationProblem
function
 
Fields inherited from class net.sourceforge.cilib.problem.OptimisationProblemAdapter
dataSetBuilder, fitnessEvaluations
 
Constructor Summary
FunctionMinimisationProblem()
           
FunctionMinimisationProblem(FunctionMinimisationProblem copy)
           
 
Method Summary
protected  Fitness calculateFitness(Type solution)
          Determine the Fitness of the current Problem instance based on the provided solution.
 FunctionMinimisationProblem getClone()
          Create a cloned copy of the current object and return it.
 double getError(Type solution)
           Returns the error for the given solution.
 
Methods inherited from class net.sourceforge.cilib.problem.FunctionOptimisationProblem
accept, getBehaviouralDomain, getDomain, getFunction, setFunction
 
Methods inherited from class net.sourceforge.cilib.problem.OptimisationProblemAdapter
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
 

Constructor Detail

FunctionMinimisationProblem

public FunctionMinimisationProblem()

FunctionMinimisationProblem

public FunctionMinimisationProblem(FunctionMinimisationProblem copy)
Method Detail

getClone

public FunctionMinimisationProblem 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 FunctionOptimisationProblem
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

calculateFitness

protected Fitness calculateFitness(Type solution)
Determine the Fitness of the current Problem instance based on the provided solution.

Specified by:
calculateFitness in class OptimisationProblemAdapter
Parameters:
solution - The Type representing the candidate solution.
Returns:
The Fitness of the solution in the current Problem.
See Also:
OptimisationProblemAdapter.getFitness(Type, boolean)

getError

public double getError(Type solution)

Returns the error for the given solution. That is, a lower error value is returned if the given solution is a better minimiser for the function.

The lowest possible error (corresponding to the best solution) should be 0. However, if the function incorrectly reports its minimum value then it is possible for error values to be negative.

Specified by:
getError in class FunctionOptimisationProblem
Parameters:
solution - The solution for which an error is saught.
Returns:
The error.


Copyright © 2009 CIRG. All Rights Reserved.