#include <ObjectiveFunction.h>
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. |
<File comment goes here!!>
Copyright (c) 2008 by <Quang Huy / NTU>
ObjectiveFunction::ObjectiveFunction | ( | int | minmax, | |
unsigned int | nDimensions, | |||
double | lowerBound, | |||
double | upperBound | |||
) |
Constructor.
<File comment goes here!!>
Copyright (c) 2008 by <Quang Huy / NTU>
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.
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. |
double ObjectiveFunction::bestEvaluation | ( | ) |
Best result so far.
vector< double > ObjectiveFunction::bestSolution | ( | ) |
Best solution so far.
bool ObjectiveFunction::isInBound | ( | vector< double > | x | ) |
Bound checking.
double ObjectiveFunction::evaluate | ( | vector< double > & | x | ) |
Evaluate the fitness value.
x | Input values. |
vector< double > ObjectiveFunction::gradient | ( | vector< double > & | x | ) |
Calculate gradient (first order derivative).
x | Input values. |
vector< double > ObjectiveFunction::finiteDifference | ( | vector< double > & | x | ) | [protected] |
Implementation of the finite differencing method to calculate the 1st order derivative.
x | Input values. |