GClasses

GClasses::GHillClimber Class Reference

#include <GHillClimber.h>

Inheritance diagram for GClasses::GHillClimber:
GClasses::GOptimizer

List of all members.

Public Member Functions

 GHillClimber (GTargetFunction *pCritic)
virtual ~GHillClimber ()
virtual double * currentVector ()
 Returns a pointer to the current vector.
double currentError ()
 Returns the error for the current vector.
void setStepSizes (double size)
 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.)
double anneal (double dev, GRand *pRand)
 You can call this method to simulate one annealing jump with the specified deviation in all dimensions.
void setChangeFactor (double d)
 d should be a value between 0 and 1

Protected Member Functions

void reset ()

Protected Attributes

size_t m_nDims
double * m_pStepSizes
double * m_pVector
double * m_pAnnealCand
double m_dError
double m_dChangeFactor

Constructor & Destructor Documentation

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

Member Function Documentation

double GClasses::GHillClimber::anneal ( double  dev,
GRand pRand 
)

You can call this method to simulate one annealing jump with the specified deviation in all dimensions.

double GClasses::GHillClimber::currentError ( ) [inline]

Returns the error for the current vector.

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

Returns a pointer to the current vector.

Implements GClasses::GOptimizer.

virtual double GClasses::GHillClimber::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.

void GClasses::GHillClimber::reset ( ) [protected]
void GClasses::GHillClimber::setChangeFactor ( double  d) [inline]

d should be a value between 0 and 1

void GClasses::GHillClimber::setStepSizes ( double  size)

Set all the current step sizes to this value.

double* GClasses::GHillClimber::stepSizes ( )

Returns the vector of step sizes.


Member Data Documentation

size_t GClasses::GHillClimber::m_nDims [protected]
double* GClasses::GHillClimber::m_pVector [protected]