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

This template represents value set which has interval of values. Intervals as specified by theirs bounds. This value set uses user-specified random generator to generate values within the interval. More...

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

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

List of all members.

Public Member Functions

 GaIntervalValueSet (const GaValueIntervalBounds< T > &values, const GaValueIntervalBounds< T > &invertedValues, GaRandom< T > *randomGenerator, bool viceVersa)
 This constructor initializes value set with bounds and random generator.
 GaIntervalValueSet (GaRandom< T > *randomGenerator)
 This constructor initializes value set with random generator, but doesn't define bounds of intervals.
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::ClosestValue method.
virtual const T &GACALL ClosestValue (const T &value) const
 More details are given in specification of GaValueSet::ClosestValue method.
const GaValueIntervalBounds< T >
&GACALL 
GetValueBounds () const
 This method is not thread-safe.
void GACALL SetValueBounds (const GaValueIntervalBounds< T > &bounds)
 SetValueBounds method sets bounds of interval of original values.
const GaValueIntervalBounds< T >
&GACALL 
GetInvertedValueBounds () const
 This method is not thread-safe.
void GACALL SetInvertedValueBounds (const GaValueIntervalBounds< T > &bounds)
 SetInvertedValueBounds method sets bounds of interval of inverted values.
void GACALL GetBounds (GaValueIntervalBounds< T > &originals, GaValueIntervalBounds< T > &inverted) const
 GetBounds method returns bounds of both intervals.
void GACALL SetBounds (const GaValueIntervalBounds< T > &originals, const GaValueIntervalBounds< T > &inverted)
 SetBounds method sets bounds of both intervals.

Private Attributes

GaValueIntervalBounds< T > _values
 Bounds of interval of original values.
GaValueIntervalBounds< T > _invertedValues
 Bounds of interval of inverted values.
GaRandom< T > * _randomGenerator
 This attribute is pointer to random generator which is used for generating of random values within interval.


Detailed Description

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

This template represents value set which has interval of values. Intervals as specified by theirs bounds. This value set uses user-specified random generator to generate values within the interval.

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 bounds. This type must support operators >, >=, < and <=.

Constructor & Destructor Documentation

template<typename T>
Chromosome::Representation::GaIntervalValueSet< T >::GaIntervalValueSet ( const GaValueIntervalBounds< T > &  values,
const GaValueIntervalBounds< T > &  invertedValues,
GaRandom< T > *  randomGenerator,
bool  viceVersa 
) [inline]

This constructor initializes value set with bounds and random generator.

Parameters:
values bounds of interval of original values.
invertedValues bounds of interval of inverted values.
randomGenerator pointer to random generator.
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.

template<typename T>
Chromosome::Representation::GaIntervalValueSet< T >::GaIntervalValueSet ( GaRandom< T > *  randomGenerator  )  [inline]

This constructor initializes value set with random generator, but doesn't define bounds of intervals.

Parameters:
randomGenerator pointer to random generator.


Member Function Documentation

template<typename T>
virtual T GACALL Chromosome::Representation::GaIntervalValueSet< 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::GaIntervalValueSet< 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::GaIntervalValueSet< T >::Belongs ( 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>
virtual const T& GACALL Chromosome::Representation::GaIntervalValueSet< 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 GaValueIntervalBounds<T>& GACALL Chromosome::Representation::GaIntervalValueSet< T >::GetValueBounds (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns bounds of interval of original values.

template<typename T>
void GACALL Chromosome::Representation::GaIntervalValueSet< T >::SetValueBounds ( const GaValueIntervalBounds< T > &  bounds  )  [inline]

SetValueBounds method sets bounds of interval of original values.

This method is not thread-safe.

Parameters:
bounds new bound of interval.

template<typename T>
const GaValueIntervalBounds<T>& GACALL Chromosome::Representation::GaIntervalValueSet< T >::GetInvertedValueBounds (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns bounds of interval of inverted values.

template<typename T>
void GACALL Chromosome::Representation::GaIntervalValueSet< T >::SetInvertedValueBounds ( const GaValueIntervalBounds< T > &  bounds  )  [inline]

SetInvertedValueBounds method sets bounds of interval of inverted values.

This method is not thread-safe.

Parameters:
bounds new bound of interval.

template<typename T>
void GACALL Chromosome::Representation::GaIntervalValueSet< T >::GetBounds ( GaValueIntervalBounds< T > &  originals,
GaValueIntervalBounds< T > &  inverted 
) const [inline]

GetBounds method returns bounds of both intervals.

This method is not thread-safe.

Parameters:
originals reference to variable to which bounds of original values are stored.
inverted reference to variable to which bounds of inverted values are stored.

template<typename T>
void GACALL Chromosome::Representation::GaIntervalValueSet< T >::SetBounds ( const GaValueIntervalBounds< T > &  originals,
const GaValueIntervalBounds< T > &  inverted 
) [inline]

SetBounds method sets bounds of both intervals.

This method is not thread-safe.

Parameters:
originals new bounds of interval of original values.
inverted new bounds of interval of inverted values.


Member Data Documentation

Bounds of interval of original values.

Bounds of interval of inverted values.

template<typename T>
GaRandom<T>* Chromosome::Representation::GaIntervalValueSet< T >::_randomGenerator [private]

This attribute is pointer to random generator which is used for generating of random values within interval.


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

Genetic Algorithm Library
Coolsoft Software Development