00001 #ifndef CSTANDARDTRANSCRIBE_H 00002 #define CSTANDARDTRANSCRIBE_H 00003 #include "GeneralTranscribe.h" 00004 00005 /** \addtogroup gainv Genetic algorithm optimization */ 00006 /* @{ */ 00007 00008 //! BinaryTranscibe implements transcription for standard binary populations 00009 /*! It works for simple binary string populations with the "canonic" decoding of the bit string 00010 * For each parameter a basevalue, stepsize and genesize has to be specified 00011 * upon construction. 00012 */ 00013 class BinaryTranscribe : public GeneralTranscribe{ 00014 protected: 00015 const ttranscribed basevalues;//!< The minimum value for each parameter 00016 const ttranscribed stepsizes;//!< The stepsize associated to a bit change for each parameter 00017 const tsizev genesizes; //!< The number of bits for each parameter 00018 public: 00019 virtual ttranscribed GetValues(const tpopmember &member); //!< Implements the abstract function from GeneralTranscribe 00020 //! Without basevalues, stepsizes and genesizes BinaryTranscribe does not work, so we inforce their use by 00021 //! including them in the constructor 00022 BinaryTranscribe(const ttranscribed &base, const ttranscribed &step,const tsizev &gene); 00023 virtual int GetNparams(){return basevalues.size();}; 00024 //! We declare a copy constructor that copies the private variables; 00025 BinaryTranscribe(const BinaryTranscribe &Old); 00026 BinaryTranscribe(const GeneralTranscribe &Old); 00027 virtual ~BinaryTranscribe(); 00028 }; 00029 /* @} */ 00030 #endif // CSTANDARDTRANSCRIBE_H
1.5.5