GClasses
|
This algorithm tries the current direction and a slightly perturbed direction at each step. If the perturbed direction resulted in faster improvement, it becomes the new current direction. As long as the current direction yields improvement, it accelerates, otherwise it decelerates. More...
#include <GHillClimber.h>
Public Member Functions | |
GAnnealing (GTargetFunction *pTargetFunc, double initialDeviation, double decay, GRand *pRand) | |
virtual | ~GAnnealing () |
virtual double | iterate () |
Performs a little more optimization. (Call this in a loop until acceptable results are found.) | |
virtual double * | currentVector () |
Returns the best vector yet found. | |
void | setDeviation (double d) |
Specify the current deviation to use for annealing. (A random vector from a Normal distribution with the specified deviation will be added to each candidate vector in order to simulate annealing.) | |
Protected Member Functions | |
void | reset () |
Protected Attributes | |
double | m_initialDeviation |
double | m_deviation |
double | m_decay |
size_t | m_dims |
double * | m_pBuf |
double * | m_pVector |
double * | m_pCandidate |
double | m_dError |
GRand * | m_pRand |
This algorithm tries the current direction and a slightly perturbed direction at each step. If the perturbed direction resulted in faster improvement, it becomes the new current direction. As long as the current direction yields improvement, it accelerates, otherwise it decelerates.
GClasses::GAnnealing::GAnnealing | ( | GTargetFunction * | pTargetFunc, |
double | initialDeviation, | ||
double | decay, | ||
GRand * | pRand | ||
) |
virtual GClasses::GAnnealing::~GAnnealing | ( | ) | [virtual] |
virtual double* GClasses::GAnnealing::currentVector | ( | ) | [inline, virtual] |
Returns the best vector yet found.
Implements GClasses::GOptimizer.
virtual double GClasses::GAnnealing::iterate | ( | ) | [virtual] |
Performs a little more optimization. (Call this in a loop until acceptable results are found.)
Implements GClasses::GOptimizer.
void GClasses::GAnnealing::reset | ( | ) | [protected] |
void GClasses::GAnnealing::setDeviation | ( | double | d | ) | [inline] |
Specify the current deviation to use for annealing. (A random vector from a Normal distribution with the specified deviation will be added to each candidate vector in order to simulate annealing.)
double GClasses::GAnnealing::m_decay [protected] |
double GClasses::GAnnealing::m_dError [protected] |
double GClasses::GAnnealing::m_deviation [protected] |
size_t GClasses::GAnnealing::m_dims [protected] |
double GClasses::GAnnealing::m_initialDeviation [protected] |
double* GClasses::GAnnealing::m_pBuf [protected] |
double* GClasses::GAnnealing::m_pCandidate [protected] |
GRand* GClasses::GAnnealing::m_pRand [protected] |
double* GClasses::GAnnealing::m_pVector [protected] |