GClasses

GClasses::GMomentumGreedySearch Class Reference

At each iteration this algorithm moves in only one dimension. If the situation doesn't improve it tries the opposite direction. If both directions are worse, it decreases the step size for that dimension, otherwise it increases the step size for that dimension. More...

#include <GHillClimber.h>

Inheritance diagram for GClasses::GMomentumGreedySearch:
GClasses::GOptimizer

List of all members.

Public Member Functions

 GMomentumGreedySearch (GTargetFunction *pCritic)
virtual ~GMomentumGreedySearch ()
virtual double * currentVector ()
 Returns a pointer to the state vector.
void setAllStepSizes (double dStepSize)
 Set all the current step sizes to this value.
double * stepSizes ()
 Returns the vector of step sizes.
virtual double iterate ()
 Makes another attempt to find a better vector. Returns the heuristic error. (Usually you will call this method in a loop until your stopping criteria has been met.)
void setChangeFactor (double d)
 d should be a value between 0 and 1

Protected Member Functions

void reset ()
double iterateOneDim ()

Protected Attributes

size_t m_nDimensions
size_t m_nCurrentDim
double * m_pStepSizes
double * m_pVector
double m_dError
double m_dChangeFactor

Detailed Description

At each iteration this algorithm moves in only one dimension. If the situation doesn't improve it tries the opposite direction. If both directions are worse, it decreases the step size for that dimension, otherwise it increases the step size for that dimension.


Constructor & Destructor Documentation

GClasses::GMomentumGreedySearch::GMomentumGreedySearch ( GTargetFunction pCritic)
virtual GClasses::GMomentumGreedySearch::~GMomentumGreedySearch ( ) [virtual]

Member Function Documentation

virtual double* GClasses::GMomentumGreedySearch::currentVector ( ) [inline, virtual]

Returns a pointer to the state vector.

Implements GClasses::GOptimizer.

virtual double GClasses::GMomentumGreedySearch::iterate ( ) [virtual]

Makes another attempt to find a better vector. Returns the heuristic error. (Usually you will call this method in a loop until your stopping criteria has been met.)

Implements GClasses::GOptimizer.

double GClasses::GMomentumGreedySearch::iterateOneDim ( ) [protected]
void GClasses::GMomentumGreedySearch::reset ( ) [protected]
void GClasses::GMomentumGreedySearch::setAllStepSizes ( double  dStepSize)

Set all the current step sizes to this value.

void GClasses::GMomentumGreedySearch::setChangeFactor ( double  d) [inline]

d should be a value between 0 and 1

double* GClasses::GMomentumGreedySearch::stepSizes ( )

Returns the vector of step sizes.


Member Data Documentation