blob: 72435ed54b26539fd151eaadd9acfed0cb582411 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef GENETIC_PHENOTYPE_BINARY_H
#define GENETIC_PHENOTYPE_BINARY_H
#include "genetic/phenotype.h"
namespace Genetic
{
class PhenotypeBinary : public Phenotype
{
public:
PhenotypeBinary( int iSize, bool bRandom=false );
virtual ~PhenotypeBinary();
virtual int getSize() { return iSize; }
virtual Phenotype &randomize();
virtual void mutate( int iLocation, float fMagnitude );
virtual Phenotype *makeEmptyOffspring( int iNewSize=-1 );
virtual Phenotype ©From( const Phenotype &rSrc, int iStart,
int iCount, int iDest=-1 );
virtual Bu::String toString();
private:
int iSize;
int iWords;
uint_fast32_t *aGenes;
};
};
#endif
|