diff options
Diffstat (limited to 'src/phenotypebinary.h')
-rw-r--r-- | src/phenotypebinary.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/phenotypebinary.h b/src/phenotypebinary.h new file mode 100644 index 0000000..72435ed --- /dev/null +++ b/src/phenotypebinary.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #ifndef GENETIC_PHENOTYPE_BINARY_H | ||
2 | #define GENETIC_PHENOTYPE_BINARY_H | ||
3 | |||
4 | #include "genetic/phenotype.h" | ||
5 | |||
6 | namespace Genetic | ||
7 | { | ||
8 | class PhenotypeBinary : public Phenotype | ||
9 | { | ||
10 | public: | ||
11 | PhenotypeBinary( int iSize, bool bRandom=false ); | ||
12 | virtual ~PhenotypeBinary(); | ||
13 | |||
14 | virtual int getSize() { return iSize; } | ||
15 | virtual Phenotype &randomize(); | ||
16 | virtual void mutate( int iLocation, float fMagnitude ); | ||
17 | virtual Phenotype *makeEmptyOffspring( int iNewSize=-1 ); | ||
18 | virtual Phenotype ©From( const Phenotype &rSrc, int iStart, | ||
19 | int iCount, int iDest=-1 ); | ||
20 | virtual Bu::String toString(); | ||
21 | |||
22 | private: | ||
23 | int iSize; | ||
24 | int iWords; | ||
25 | uint_fast32_t *aGenes; | ||
26 | }; | ||
27 | }; | ||
28 | |||
29 | #endif | ||