GaFitnessCriteriaParams
class is used by GaFitnessCriteria class as parameters for the criteria. It contains desired fitness value of specified type and it also specifies type of comparison which is used to compare desired and current fitness values.
More...
#include <D:/Temp/vs/gal/source/StopCriterias.h>
Inherits Algorithm::GaStopCriteriaParams.
Public Member Functions | |
GaFitnessCriteriaParams (float fitnessLimit, GaFitnessCriteriaComparison comparison, GaStatValueType valueType) | |
This constructor initializes parameters with user-defined values. | |
GaFitnessCriteriaParams () | |
This constructor initializes parameters with default values. Default desired fitness value is 1, type of comparison is GFC_EQUALS_THEN and type of fitness value is GSV_BEST_FITNESS_SCALED . | |
virtual GaParameters *GACALL | Clone () const |
More details are given in specification of GaParameters::Clone method. | |
float GACALL | GetFitnessLimit () const |
This method is not thread-safe. | |
void GACALL | SetFitnessLimit (float limit) |
SetFitnessLimit method sets desired fitness value. | |
GaFitnessCriteriaComparison GACALL | GetComparison () const |
This method is not thread-safe. | |
void GACALL | SetComparison (GaFitnessCriteriaComparison comparison) |
SetComparation method sets type of comparison of desired value and current value. | |
GaStatValueType GACALL | GetValueType () const |
This method is not thread-safe. | |
void GACALL | SetValueType (GaStatValueType type) |
SetValueType method sets type of fitness values which are compared. | |
Private Attributes | |
float | _fitnessLimit |
Stores desired fitness value for stopping the algorithm. | |
GaFitnessCriteriaComparison | _comparison |
Type of comparison of desired value and current value. | |
GaStatValueType | _valueType |
Type of fitness values which are compared. |
GaFitnessCriteriaParams
class is used by GaFitnessCriteria class as parameters for the criteria. It contains desired fitness value of specified type and it also specifies type of comparison which is used to compare desired and current fitness values.
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::GaFitnessCriteriaParams::GaFitnessCriteriaParams | ( | float | fitnessLimit, | |
GaFitnessCriteriaComparison | comparison, | |||
GaStatValueType | valueType | |||
) | [inline] |
This constructor initializes parameters with user-defined values.
fitnessLimit | desired fitness value. | |
comparison | type of comparison of desired and current fitness values. | |
valueType | type of fitness values which are compared. |
Algorithm::StopCriterias::GaFitnessCriteriaParams::GaFitnessCriteriaParams | ( | ) | [inline] |
This constructor initializes parameters with default values. Default desired fitness value is 1, type of comparison is GFC_EQUALS_THEN
and type of fitness value is GSV_BEST_FITNESS_SCALED
.
virtual GaParameters* GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::Clone | ( | ) | const [inline, virtual] |
More details are given in specification of GaParameters::Clone method.
Implements Common::GaParameters.
float GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::GetFitnessLimit | ( | ) | const [inline] |
This method is not thread-safe.
void GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::SetFitnessLimit | ( | float | limit | ) | [inline] |
SetFitnessLimit
method sets desired fitness value.
This method is not thread-safe.
limit | desired fitness value. |
GaFitnessCriteriaComparison GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::GetComparison | ( | ) | const [inline] |
This method is not thread-safe.
void GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::SetComparison | ( | GaFitnessCriteriaComparison | comparison | ) | [inline] |
SetComparation
method sets type of comparison of desired value and current value.
This method is not thread-safe.
comparison | type of comparison. |
GaStatValueType GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::GetValueType | ( | ) | const [inline] |
This method is not thread-safe.
void GACALL Algorithm::StopCriterias::GaFitnessCriteriaParams::SetValueType | ( | GaStatValueType | type | ) | [inline] |
SetValueType
method sets type of fitness values which are compared.
This method is not thread-safe.
type | – type of fitness values. |
float Algorithm::StopCriterias::GaFitnessCriteriaParams::_fitnessLimit [private] |
Stores desired fitness value for stopping the algorithm.
GaFitnessCriteriaComparison Algorithm::StopCriterias::GaFitnessCriteriaParams::_comparison [private] |
Type of comparison of desired value and current value.
Type of fitness values which are compared.