#include <D:/Temp/vs/gal/source/ValueSets.h>
Inherited by Chromosome::Representation::GaCombinedValueSet< T >, Chromosome::Representation::GaIntervalValueSet< T >, Chromosome::Representation::GaMultiValueSet< T >, Chromosome::Representation::GaSingleValueSet< T >, and Chromosome::Representation::GaUnboundValueSet< T >.
Public Member Functions | |
GaValueSet (bool viceVersa) | |
This constructor initializes value set with user-defined treatment of inverted values. | |
GaValueSet () | |
This constructor initializes value set with inverted values as members of the set. | |
virtual | ~GaValueSet () |
Because this is base class, virtual destructor must be defined in order to enable calling of right destructor (destructor of inheriting class). | |
virtual T GACALL | GenerateRandom () const =0 |
This method returns randomly chosen value from the set. | |
virtual bool GACALL | Inverse (const T &value, T &inverted) const =0 |
Inverse method finds inverted value and stores it into inverted. | |
virtual bool GACALL | Belongs (const T &value) const =0 |
Belongs method checks membership of the value in this value set. | |
virtual const T &GACALL | ClosestValue (const T &value) const =0 |
ClosestValue method returns nearest value which can be found in value set to specified value. | |
bool GACALL | GetViceVersa () const |
This method is not thread-safe. | |
void GACALL | SetViceVersa (bool viceVersa) |
SetViceVersa method sets treatment of inverted values. | |
Protected Attributes | |
bool | _viceVersa |
This attribute indicates that membership of original sets of values and inverted set of values are treated equally. If this attribute is set to true , inverted values are treated as members of the set, if it is set to false , inverted values are not treated as members of the set. |
This class has built-in synchronizator so it is allowed to use LOCK_OBJECT
and LOCK_THIS_OBJECT
macros with instances of this class, but no public or private methods are thread-safe.
T | type of data in value set. |
Chromosome::Representation::GaValueSet< T >::GaValueSet | ( | bool | viceVersa | ) | [inline] |
This constructor initializes value set with user-defined treatment of inverted values.
viceVersa | if this parameter is set to true , inverted values are treated as members of the set, if it is set to false , inverted values are not treated as members of the set. |
Chromosome::Representation::GaValueSet< T >::GaValueSet | ( | ) | [inline] |
This constructor initializes value set with inverted values as members of the set.
virtual Chromosome::Representation::GaValueSet< T >::~GaValueSet | ( | ) | [inline, virtual] |
Because this is base class, virtual destructor must be defined in order to enable calling of right destructor (destructor of inheriting class).
virtual T GACALL Chromosome::Representation::GaValueSet< T >::GenerateRandom | ( | ) | const [pure virtual] |
This method returns randomly chosen value from the set.
Implemented in Chromosome::Representation::GaSingleValueSet< T >, Chromosome::Representation::GaMultiValueSet< T >, Chromosome::Representation::GaIntervalValueSet< T >, Chromosome::Representation::GaCombinedValueSet< T >, and Chromosome::Representation::GaUnboundValueSet< T >.
virtual bool GACALL Chromosome::Representation::GaValueSet< T >::Inverse | ( | const T & | value, | |
T & | inverted | |||
) | const [pure virtual] |
Inverse
method finds inverted value and stores it into inverted.
value | value which should be inverted. | |
inverted | reference to variable to which inverted value is going to be stored. |
true
if inversion is successful. If specified value is not in set or it cannot be inverted it returns false
.Implemented in Chromosome::Representation::GaSingleValueSet< T >, Chromosome::Representation::GaMultiValueSet< T >, Chromosome::Representation::GaIntervalValueSet< T >, Chromosome::Representation::GaCombinedValueSet< T >, and Chromosome::Representation::GaUnboundValueSet< T >.
virtual bool GACALL Chromosome::Representation::GaValueSet< T >::Belongs | ( | const T & | value | ) | const [pure virtual] |
Belongs
method checks membership of the value in this value set.
value | value which is checked. |
true
if the value is member of the set.Implemented in Chromosome::Representation::GaSingleValueSet< T >, Chromosome::Representation::GaMultiValueSet< T >, Chromosome::Representation::GaIntervalValueSet< T >, Chromosome::Representation::GaCombinedValueSet< T >, and Chromosome::Representation::GaUnboundValueSet< T >.
virtual const T& GACALL Chromosome::Representation::GaValueSet< T >::ClosestValue | ( | const T & | value | ) | const [pure virtual] |
ClosestValue
method returns nearest value which can be found in value set to specified value.
value | value which nearest neighbor should be found. |
Implemented in Chromosome::Representation::GaSingleValueSet< T >, Chromosome::Representation::GaMultiValueSet< T >, Chromosome::Representation::GaIntervalValueSet< T >, Chromosome::Representation::GaCombinedValueSet< T >, and Chromosome::Representation::GaUnboundValueSet< T >.
bool GACALL Chromosome::Representation::GaValueSet< T >::GetViceVersa | ( | ) | const [inline] |
This method is not thread-safe.
true
if both, original values and inverted values, treated as members of the set, or returns false
, if inverted values are not treated as members.void GACALL Chromosome::Representation::GaValueSet< T >::SetViceVersa | ( | bool | viceVersa | ) | [inline] |
SetViceVersa
method sets treatment of inverted values.
This method is not thread-safe.
viceVersa | if this parameter is set to true , inverted values are treated as members of the set, if it is set to false , inverted values are not treated as members of the set. |
bool Chromosome::Representation::GaValueSet< T >::_viceVersa [protected] |
This attribute indicates that membership of original sets of values and inverted set of values are treated equally. If this attribute is set to true
, inverted values are treated as members of the set, if it is set to false
, inverted values are not treated as members of the set.