Remember Chromosome's generation; Allow set bits by string
This commit is contained in:
12
Chromosome.h
12
Chromosome.h
@ -19,6 +19,9 @@
|
||||
//
|
||||
namespace BitEvolver
|
||||
{
|
||||
//
|
||||
using std::string;
|
||||
|
||||
//
|
||||
class Chromosome
|
||||
{
|
||||
@ -32,6 +35,11 @@ namespace BitEvolver
|
||||
void Reset();
|
||||
void Randomize();
|
||||
|
||||
//
|
||||
void SetGenerationNumber(int g);
|
||||
void IncrementGenerationNumber();
|
||||
int GetGenerationNumber();
|
||||
|
||||
//
|
||||
void SetBitCount(int count);
|
||||
int GetBitCount();
|
||||
@ -42,6 +50,7 @@ namespace BitEvolver
|
||||
//
|
||||
bool GetBit(int index);
|
||||
void SetBit(int index, bool b);
|
||||
void SetBits(string s);
|
||||
|
||||
//
|
||||
void ResetFitness();
|
||||
@ -69,6 +78,9 @@ namespace BitEvolver
|
||||
// Random number generator
|
||||
std::shared_ptr<class Random> random;
|
||||
|
||||
//
|
||||
int generation_number;
|
||||
|
||||
//
|
||||
std::vector<bool> bits;
|
||||
int bits_count_desired;
|
||||
|
Reference in New Issue
Block a user