Chromosome::Representation::GaSingleValueSet< T > Class Template Reference

This template represents value set with only one value and its counterpart (inverted value). More...

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

Inherits Chromosome::Representation::GaValueSet< T >< T >.

List of all members.

Public Member Functions

 GaSingleValueSet (const T &value, const T &invertedValue, bool viceVersa)
 This constructor initializes value set with value and its counterpart.
virtual T GACALL GenerateRandom () const
 More details are given in specification of GaValueSet::GenerateRandom method.
virtual bool GACALL Inverse (const T &value, T &inverted) const
 More details are given in specification of GaValueSet::Inverse method.
virtual bool GACALL Belongs (const T &value) const
 More details are given in specification of GaValueSet::Belongs method.
virtual const T &GACALL ClosestValue (const T &value) const
 More details are given in specification of GaValueSet::ClosestValue method.
const T &GACALL GetValue () const
 This method is not thread-safe.
const T &GACALL GetInvertedValue () const
 This method is not thread-safe.
void GACALL GetValue (T &original, T &inverted)
 GetValue method returns original value and its counterpart.
void GACALL SetValue (const T &value)
 SetValue method sets original value.
void GACALL SetValue (const T &original, const T &inverted)
 SetValue method sets original value and its counterpart.
void GACALL SetInvertedValue (const T &value)
 SetValue method sets inverted value.

Private Attributes

_value
 Original value of the set.
_invertedValue
 _value's counterpart (inverted value) in the set.


Detailed Description

template<typename T>
class Chromosome::Representation::GaSingleValueSet< T >

This template represents value set with only one value and its counterpart (inverted value).

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.

Parameters:
T type of data in value set.

Constructor & Destructor Documentation

template<typename T>
Chromosome::Representation::GaSingleValueSet< T >::GaSingleValueSet ( const T &  value,
const T &  invertedValue,
bool  viceVersa 
) [inline]

This constructor initializes value set with value and its counterpart.

Parameters:
value original value.
invertedValue inverted value.
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.


Member Function Documentation

template<typename T>
virtual T GACALL Chromosome::Representation::GaSingleValueSet< T >::GenerateRandom (  )  const [inline, virtual]

More details are given in specification of GaValueSet::GenerateRandom method.

This method is not thread-safe.

Implements Chromosome::Representation::GaValueSet< T >.

template<typename T>
virtual bool GACALL Chromosome::Representation::GaSingleValueSet< T >::Inverse ( const T &  value,
T &  inverted 
) const [inline, virtual]

More details are given in specification of GaValueSet::Inverse method.

This method is not thread-safe.

Implements Chromosome::Representation::GaValueSet< T >.

template<typename T>
virtual bool GACALL Chromosome::Representation::GaSingleValueSet< T >::Belongs ( const T &  value  )  const [inline, virtual]

More details are given in specification of GaValueSet::Belongs method.

This method is not thread-safe.

Implements Chromosome::Representation::GaValueSet< T >.

template<typename T>
virtual const T& GACALL Chromosome::Representation::GaSingleValueSet< T >::ClosestValue ( const T &  value  )  const [inline, virtual]

More details are given in specification of GaValueSet::ClosestValue method.

This method is not thread-safe.

Implements Chromosome::Representation::GaValueSet< T >.

template<typename T>
const T& GACALL Chromosome::Representation::GaSingleValueSet< T >::GetValue (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns original value.

template<typename T>
const T& GACALL Chromosome::Representation::GaSingleValueSet< T >::GetInvertedValue (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns inverted value of the original.

template<typename T>
void GACALL Chromosome::Representation::GaSingleValueSet< T >::GetValue ( T &  original,
T &  inverted 
) [inline]

GetValue method returns original value and its counterpart.

This method is not thread-safe.

Parameters:
original reference to variable to which original value will be stored.
inverted reference to variable to which inverted value will be stored.

template<typename T>
void GACALL Chromosome::Representation::GaSingleValueSet< T >::SetValue ( const T &  value  )  [inline]

SetValue method sets original value.

This method is not thread-safe.

Parameters:
value new original value.

template<typename T>
void GACALL Chromosome::Representation::GaSingleValueSet< T >::SetValue ( const T &  original,
const T &  inverted 
) [inline]

SetValue method sets original value and its counterpart.

This method is not thread-safe.

Parameters:
original new original value.
inverted new inverted value.

template<typename T>
void GACALL Chromosome::Representation::GaSingleValueSet< T >::SetInvertedValue ( const T &  value  )  [inline]

SetValue method sets inverted value.

This method is not thread-safe.

Parameters:
value new inverted value.


Member Data Documentation

template<typename T>
T Chromosome::Representation::GaSingleValueSet< T >::_value [private]

Original value of the set.

template<typename T>
T Chromosome::Representation::GaSingleValueSet< T >::_invertedValue [private]

_value's counterpart (inverted value) in the set.


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

Genetic Algorithm Library
Coolsoft Software Development