Modernized GAlib
3.0.0 current
|
This header defines the interface for the 2D binary string genome, including crossover objects and all the default and built-in operators. More...
#include <GA2DBinStrGenome.h>
Public Member Functions | |
GADefineIdentity ("GA2DBinaryStringGenome", GAID::BinaryStringGenome2D) | |
GA2DBinaryStringGenome (unsigned int x, unsigned int y, GAGenome::Evaluator f=(GAGenome::Evaluator) nullptr, void *u=nullptr) | |
GA2DBinaryStringGenome (const GA2DBinaryStringGenome &orig) | |
GA2DBinaryStringGenome & | operator= (const GAGenome &arg) |
GA2DBinaryStringGenome & | operator= (const short array[]) |
GA2DBinaryStringGenome & | operator= (const int array[]) |
GAGenome * | clone (GAGenome::CloneMethod flag=CloneMethod::CONTENTS) const override |
void | copy (const GAGenome &chrom) override |
int | read (std::istream &) override |
int | write (std::ostream &) const override |
bool | equal (const GAGenome &c) const override |
short | gene (unsigned int x, unsigned int y) const |
short | gene (unsigned int x, unsigned int y, short value) |
int | width () const |
int | width (int w) |
int | height () const |
int | height (int h) |
int | resize (int x, int y) |
int | resizeBehaviour (Dimension which) const |
int | resizeBehaviour (Dimension which, unsigned int lowerX, unsigned int upperX) |
int | resizeBehaviour (unsigned int lowerX, unsigned int upperX, unsigned int lowerY, unsigned int upperY) |
void | copy (const GA2DBinaryStringGenome &, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) |
bool | equal (const GA2DBinaryStringGenome &, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) const |
void | set (unsigned int, unsigned int, unsigned int, unsigned int) |
void | unset (unsigned int, unsigned int, unsigned int, unsigned int) |
void | randomize (unsigned int, unsigned int, unsigned int, unsigned int) |
void | randomize () |
void | move (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) |
![]() | |
GABinaryString (unsigned int s) | |
void | copy (const GABinaryString &orig) |
Copy the contents of the bitstream. More... | |
int | resize (unsigned int x) |
Resize the bitstream to the specified number of bits. More... | |
int | size () const |
short | bit (unsigned int a) const |
short | bit (unsigned int a, short val) |
bool | equal (const GABinaryString &rhs, unsigned int lhsIdx, unsigned int rhsIdx, unsigned int l) const |
Are two (subset) bitstreams equal? More... | |
void | copy (const GABinaryString &orig, unsigned int destIdx, unsigned int origIdx, unsigned int l) |
void | move (unsigned int destIdx, unsigned int sourceIdx, unsigned int l) |
Copy (sub) bitstream. More... | |
void | set (unsigned int a, unsigned int l) |
void | unset (unsigned int a, unsigned int l) |
void | randomize (unsigned int a, unsigned int l) |
void | randomize () |
![]() | |
GADefineIdentity ("GAGenome", GAID::Genome) | |
GAGenome (Initializer i=nullptr, Mutator m=nullptr, Comparator c=nullptr) | |
GAGenome (const GAGenome &orig) | |
GAGenome & | operator= (const GAGenome &arg) |
virtual bool | notequal (const GAGenome &g) const |
int | nevals () const |
float | score () const |
float | score (float s) |
float | fitness () |
float | fitness (float f) |
GAGeneticAlgorithm * | geneticAlgorithm () const |
GAGeneticAlgorithm * | geneticAlgorithm (GAGeneticAlgorithm &g) |
void * | userData () const |
void * | userData (void *u) |
GAEvalData * | evalData () const |
GAEvalData * | evalData (const GAEvalData &o) |
float | evaluate (bool flag=false) const |
Evaluator | evaluator () const |
Evaluator | evaluator (Evaluator f) |
void | initialize () |
Initializer | initializer () const |
Initializer | initializer (Initializer op) |
int | mutate (float p) |
Mutator | mutator () const |
Mutator | mutator (Mutator op) |
float | compare (const GAGenome &g) const |
Comparator | comparator () const |
Comparator | comparator (Comparator c) |
SexualCrossover | crossover (SexualCrossover f) |
SexualCrossover | sexual () const |
AsexualCrossover | crossover (AsexualCrossover f) |
AsexualCrossover | asexual () const |
![]() | |
bool | sameClass (const GAID &b) const |
virtual const char * | className () const |
virtual int | classID () const |
Static Public Member Functions | |
static void | UniformInitializer (GAGenome &) |
static void | UnsetInitializer (GAGenome &) |
static void | SetInitializer (GAGenome &) |
static int | FlipMutator (GAGenome &, float) |
static float | BitComparator (const GAGenome &, const GAGenome &) |
static int | UniformCrossover (const GAGenome &, const GAGenome &, GAGenome *, GAGenome *) |
static int | EvenOddCrossover (const GAGenome &, const GAGenome &, GAGenome *, GAGenome *) |
static int | OnePointCrossover (const GAGenome &, const GAGenome &, GAGenome *, GAGenome *) |
![]() | |
static void | NoInitializer (GAGenome &) |
static int | NoMutator (GAGenome &, float) |
static float | NoComparator (const GAGenome &, const GAGenome &) |
Protected Attributes | |
unsigned int | nx |
unsigned int | ny |
unsigned int | minX |
unsigned int | minY |
unsigned int | maxX |
unsigned int | maxY |
![]() | |
std::vector< GABit > | data |
the data themselves | |
![]() | |
float | _score |
float | _fitness |
bool | _evaluated |
unsigned int | _neval |
GAGeneticAlgorithm * | ga |
void * | ud |
Evaluator | eval |
GAEvalData * | evd |
Mutator | mutr |
Initializer | init |
Comparator | cmp |
SexualCrossover | sexcross |
AsexualCrossover | asexcross |
Additional Inherited Members | |
![]() | |
enum class | Dimension { LENGTH = 0 , WIDTH = 0 , HEIGHT = 1 , DEPTH = 2 } |
enum class | CloneMethod { CONTENTS = 0 , ATTRIBUTES = 1 } |
enum | { FIXED_SIZE = -1 , ANY_SIZE = -10 } |
using | Evaluator = float(*)(GAGenome &) |
using | Initializer = void(*)(GAGenome &) |
using | Mutator = int(*)(GAGenome &, float) |
using | Comparator = float(*)(const GAGenome &, const GAGenome &) |
using | SexualCrossover = int(*)(const GAGenome &, const GAGenome &, GAGenome *, GAGenome *) |
using | AsexualCrossover = int(*)(const GAGenome &, GAGenome *) |
![]() | |
enum | { BaseGA = 0 , SimpleGA , SteadyStateGA , IncrementalGA , DemeGA , Population = 10 , Scaling = 15 , NoScaling , LinearScaling , SigmaTruncationScaling , PowerLawScaling , Sharing , Selection = 40 , RankSelection , RouletteWheelSelection , TournamentSelection , UniformSelection , SRSSelection , DSSelection , Genome = 50 , BinaryStringGenome , BinaryStringGenome2D , BinaryStringGenome3D , Bin2DecGenome , ListGenome , TreeGenome , ArrayGenome , ArrayGenome2D , ArrayGenome3D , ArrayAlleleGenome , ArrayAlleleGenome2D , ArrayAlleleGenome3D , StringGenome , FloatGenome , IntGenome , DoubleGenome } |
This header defines the interface for the 2D binary string genome, including crossover objects and all the default and built-in operators.