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.
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 |
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.
Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GaFitnessProgressCriteriaParams | ( | float | progress, | |
bool | absolute, | |||
GaFitnessCriteriaComparison | comparison, | |||
GaStatValueType | valueType, | |||
int | historyDepth | |||
) | [inline] |
This constructor initializes parameters with user-defined values.
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.
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.
void GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::SetRequiredProgress | ( | float | progress | ) | [inline] |
SetRequiredProgress
method sets required progress of fitness value.
This method is not thread-safe.
progress | required progress. |
bool GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetAbsolute | ( | ) | const [inline] |
This method is not thread-safe.
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.
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.
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.
comparison | type of comparison. |
GaStatValueType GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetValueType | ( | ) | const [inline] |
This method is not thread-safe.
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.
type | type of fitness value. |
int GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetHistoryDepth | ( | ) | const [inline] |
This method is not thread-safe.
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.
depth | number of generations. |
int GACALL Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::GetCurrent | ( | ) | const [inline, private] |
This method is not thread-safe.
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.
current | current number of generations. |
friend class GaFitnessProgressCriteria [friend] |
Required progress of fitness value.
If this attribute is true
, absolute progress of fitness value is measured, otherwise relative progress is measured.
GaFitnessCriteriaComparison Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::_comparison [private] |
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.
int Algorithm::StopCriterias::GaFitnessProgressCriteriaParams::_current [mutable, private] |
Current number of continuously generations which failed to meet required progress of fitness value.