GPLIB++
BinaryTranscribe.h
Go to the documentation of this file.
1 #ifndef CSTANDARDTRANSCRIBE_H
2 #define CSTANDARDTRANSCRIBE_H
3 #include "GeneralTranscribe.h"
4 
5 namespace gplib
6  {
7  /** \addtogroup gainv Genetic algorithm optimization */
8  /* @{ */
9 
10  //! BinaryTranscibe implements transcription for standard binary populations
11  /*! It works for simple binary string populations with the "canonic" decoding of the bit string
12  * For each parameter a basevalue, stepsize and genesize has to be specified
13  * upon construction. These three vectors have to have identical size.
14  */
16  {
17  protected:
18  //! The minimum value for each parameter
20  //! The stepsize associated to a bit change for each parameter
22  //! The number of bits for each parameter
24  public:
25  //! Implements the abstract function from GeneralTranscribe
26  virtual ttranscribed GetValues(const tpopmember &member);
27  //! Without basevalues, stepsizes and genesizes BinaryTranscribe does not work, so we enforce their use by including them in the constructor
28  BinaryTranscribe(const ttranscribed &base, const ttranscribed &step,
29  const tsizev &gene);
30  //! Returns the number of parameters that are encoded in the binary string
31  virtual int GetNparams()
32  {
33  return basevalues.size();
34  }
35  ;
36  //! We declare a copy constructor that copies the private variables;
39  virtual ~BinaryTranscribe();
40  };
41  /* @} */
42  }
43 #endif // CSTANDARDTRANSCRIBE_H
BinaryTranscibe implements transcription for standard binary populations.
ublas::vector< double > ttranscribed
Definition: gentypes.h:21
BinaryTranscribe(const ttranscribed &base, const ttranscribed &step, const tsizev &gene)
Without basevalues, stepsizes and genesizes BinaryTranscribe does not work, so we enforce their use b...
virtual ttranscribed GetValues(const tpopmember &member)
Implements the abstract function from GeneralTranscribe.
const ttranscribed stepsizes
The stepsize associated to a bit change for each parameter.
ublas::vector< bool > tpopmember
Definition: gentypes.h:22
General Transcribe base class for genetic algorithm parameter transcription.
virtual int GetNparams()
Returns the number of parameters that are encoded in the binary string.
const tsizev genesizes
The number of bits for each parameter.
ublas::vector< int > tsizev
Definition: gentypes.h:27
const ttranscribed basevalues
The minimum value for each parameter.