ObjectiveFunction Class Reference

The super class for objective functions. More...

#include <ObjectiveFunction.h>

Inheritance diagram for ObjectiveFunction:

FAckley FBump FElliptic FFMS FGriewank FGriewankRosenbrock FRastrigin FRosenbrock FScaffer FSchwefel102 FSchwefel102Noisy FSphere FStep FWeierstrass

List of all members.

Public Member Functions

 ObjectiveFunction (int minmax, unsigned int nDimensions, double lowerBound, double upperBound)
 Constructor.
 ObjectiveFunction (int minmax, unsigned int nDimensions, vector< double > &lowerBounds, vector< double > &upperBounds)
 Write brief comment for ObjectiveFunction here.
 ~ObjectiveFunction ()
 Destructor.
unsigned int nDimensions ()
 Number of optimization variables.
double bestEvaluation ()
 Best result so far.
vector< double > bestSolution ()
 Best solution so far.
bool isInBound (vector< double > x)
 Bound checking.
double operator() (vector< double > &x)
 Wrapper of the evaluate function.
double evaluate (vector< double > &x)
 Evaluate the fitness value.
vector< double > gradient (vector< double > &x)
 Calculate gradient (first order derivative).

Protected Member Functions

vector< double > finiteDifference (vector< double > &x)
 Implementation of the finite differencing method to calculate the 1st order derivative.


Detailed Description

The super class for objective functions.

<File comment goes here!!>

Copyright (c) 2008 by <Quang Huy / NTU>


Constructor & Destructor Documentation

ObjectiveFunction::ObjectiveFunction ( int  minmax,
unsigned int  nDimensions,
double  lowerBound,
double  upperBound 
)

Constructor.

<File comment goes here!!>

Copyright (c) 2008 by <Quang Huy / NTU>

Parameters:
minmax Minimize or maximize(0 = minimize, 1 = maximize).
nDimensions Number of optimization variables.
lowerBound Lower bound value, applied for all variables.
upperBound Upper bound value, applied for all variables.

ObjectiveFunction::ObjectiveFunction ( int  minmax,
unsigned int  nDimensions,
vector< double > &  lowerBounds,
vector< double > &  upperBounds 
)

Write brief comment for ObjectiveFunction here.

Parameters:
minmax Minimize or maximize(0 = minimize, 1 = maximize).
nDimensions Number of optimization variables.
lowerBounds Vector of lower bound values.
upperBounds Vector of upper bound values.


Member Function Documentation

double ObjectiveFunction::bestEvaluation (  ) 

Best result so far.

Returns:
Best objective value obtained.
Remarks:
Dependent on the minmax value.
See also:
ObjectiveFunction::bestSolution()

vector< double > ObjectiveFunction::bestSolution (  ) 

Best solution so far.

Returns:
The soultion with the best fitness value.
Remarks:
Dependent on the minmax value.
See also:
ObjectiveFunction::bestEvaluation()

bool ObjectiveFunction::isInBound ( vector< double >  x  ) 

Bound checking.

Returns:
True if all the variables is inbound, false otherwise.
Check if the chromsome is within the given bounds.

Remarks:
Used in many local search / constrained optimization problem

double ObjectiveFunction::evaluate ( vector< double > &  x  ) 

Evaluate the fitness value.

Parameters:
x Input values.
Returns:
Fitness value.
See also:
ObjectiveFunction::gradient()

vector< double > ObjectiveFunction::gradient ( vector< double > &  x  ) 

Calculate gradient (first order derivative).

Parameters:
x Input values.
Returns:
Gradient vector.
See also:
ObjectiveFunction::evaluate()

vector< double > ObjectiveFunction::finiteDifference ( vector< double > &  x  )  [protected]

Implementation of the finite differencing method to calculate the 1st order derivative.

Parameters:
x Input values.
Returns:
Gradient vector.
Remarks:
Machine dependent. Should only be used when analytical gradient is not available.
See also:
ObjectiveFunction::gradient


The documentation for this class was generated from the following files:

Generated on Thu Aug 28 18:34:50 2008 for Dolphin by  doxygen 1.5.6