Algorithm::StopCriterias::GaFitnessProgressCriteriaParams Class Reference

GaFitnessProgressCriteriaParams class is used by GaFitnessProgressCriteria class as parameters for the criteria. It contains desired progress of fitness value of specified type; it also specifies type of comparison which is used to compare desired and current progresses and number of generation which should continuously fail to meet required progress before algorithm stops. More...

#include <D:/Temp/vs/gal/source/StopCriterias.h>

Inherits Algorithm::GaStopCriteriaParams.

List of all members.

Public Member Functions

 GaFitnessProgressCriteriaParams (float progress, bool absolute, GaFitnessCriteriaComparison comparison, GaStatValueType valueType, int historyDepth)
 This constructor initializes parameters with user-defined values.
 GaFitnessProgressCriteriaParams ()
 This constructor initializes parameters with default values. Required progress is 0 and absolute progress is measured, comparison type is GFC_EQUALS_TO, fitness type is GSV_BEST_FITNESS_SCALED and history depth is 10.
virtual GaParameters *GACALL Clone () const
 More details are given in specification of GaParameters::Clone method.
float GACALL GetRequiredProgress () const
 This method is not thread-safe.
void GACALL SetRequiredProgress (float progress)
 SetRequiredProgress method sets required progress of fitness value.
bool GACALL GetAbsolute () const
 This method is not thread-safe.
void GACALL SetAbsolute (bool absolute)
 SetAbsolute method sets whether the absolute or relative progress of fitness value is going to be measured.
GaFitnessCriteriaComparison GACALL GetComparison () const
 This method is not thread-safe.
void GACALL SetComparison (GaFitnessCriteriaComparison comparison)
 SetComparation method sets type of comparison of desired progress and current progress.
GaStatValueType GACALL GetValueType () const
 This method is not thread-safe.
void GACALL SetValueType (GaStatValueType type)
 SetValueType method sets type of fitness values which progress is measured.
int GACALL GetHistoryDepth () const
 This method is not thread-safe.
void GACALL SetHistoryDepth (int depth)
 SetHistoryDepth method sets number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.

Private Member Functions

int GACALL GetCurrent () const
 This method is not thread-safe.
void GACALL SetCurrent (int current) const
 SetCurrent method sets current number of continuously generations which failed to meet required progress of fitness value.

Private Attributes

float _requiredProgress
 Required progress of fitness value.
bool _absolute
 If this attribute is true, absolute progress of fitness value is measured, otherwise relative progress is measured.
GaFitnessCriteriaComparison _comparison
 Type of comparison of desired progress and current progress.
GaStatValueType _valueType
 Type of fitness values which progress is measured.
int _historyDepth
 Number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.
int _current
 Current number of continuously generations which failed to meet required progress of fitness value.

Friends

class GaFitnessProgressCriteria


Detailed Description

GaFitnessProgressCriteriaParams class is used by GaFitnessProgressCriteria class as parameters for the criteria. It contains desired progress of fitness value of specified type; it also specifies type of comparison which is used to compare desired and current progresses and number of generation which should continuously fail to meet required progress before algorithm stops.

This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. No public or private methods are thread-safe.


Constructor & Destructor Documentation

Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GaFitnessProgressCriteriaParams ( float  progress,
bool  absolute,
GaFitnessCriteriaComparison  comparison,
GaStatValueType  valueType,
int  historyDepth 
) [inline]

This constructor initializes parameters with user-defined values.

Parameters:
progress required progress of fitness value.
absolute if this parameters is true, absolute progress of fitness value is measured, otherwise relative progress is measured.
comparison type of comparison of desired progress and current progress.
valueType type of fitness values which progress is measured.
historyDepth number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.

Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GaFitnessProgressCriteriaParams (  )  [inline]

This constructor initializes parameters with default values. Required progress is 0 and absolute progress is measured, comparison type is GFC_EQUALS_TO, fitness type is GSV_BEST_FITNESS_SCALED and history depth is 10.


Member Function Documentation

virtual GaParameters* GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::Clone (  )  const [inline, virtual]

More details are given in specification of GaParameters::Clone method.

Implements Common::GaParameters.

float GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetRequiredProgress (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns required progress of fitness value.

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetRequiredProgress ( float  progress  )  [inline]

SetRequiredProgress method sets required progress of fitness value.

This method is not thread-safe.

Parameters:
progress required progress.

bool GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetAbsolute (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns true if absolute progress of fitness value is measured. If relative progress is measured, method returns false.

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetAbsolute ( bool  absolute  )  [inline]

SetAbsolute method sets whether the absolute or relative progress of fitness value is going to be measured.

This method is not thread-safe.

Parameters:
absolute if this parameters is true, absolute progress of fitness value is measured, otherwise relative progress is measured.

GaFitnessCriteriaComparison GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetComparison (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns type of comparison of desired progress and current progress

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetComparison ( GaFitnessCriteriaComparison  comparison  )  [inline]

SetComparation method sets type of comparison of desired progress and current progress.

This method is not thread-safe.

Parameters:
comparison type of comparison.

GaStatValueType GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetValueType (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns type of fitness values which progress is measured.

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetValueType ( GaStatValueType  type  )  [inline]

SetValueType method sets type of fitness values which progress is measured.

This method is not thread-safe.

Parameters:
type type of fitness value.

int GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetHistoryDepth (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetHistoryDepth ( int  depth  )  [inline]

SetHistoryDepth method sets number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.

This method is not thread-safe.

Parameters:
depth number of generations.

int GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetCurrent (  )  const [inline, private]

This method is not thread-safe.

Returns:
Method returns current number of continuously generations which failed to meet required progress of fitness value.

void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetCurrent ( int  current  )  const [inline, private]

SetCurrent method sets current number of continuously generations which failed to meet required progress of fitness value.

This method is not thread-safe.

Parameters:
current current number of generations.


Friends And Related Function Documentation

friend class GaFitnessProgressCriteria [friend]


Member Data Documentation

Required progress of fitness value.

If this attribute is true, absolute progress of fitness value is measured, otherwise relative progress is measured.

Type of comparison of desired progress and current progress.

Type of fitness values which progress is measured.

Number of continuously generations which should fail to meet required progress of fitness value before algorithm stops its execution.

Current number of continuously generations which failed to meet required progress of fitness value.


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

Genetic Algorithm Library
Coolsoft Software Development