|
Modernized GAlib
3.0.0 current
|
Interface for the 1D binary string genome, including crossover objects and all the default and built-in operators. More...
#include <GA1DBinStrGenome.h>
Public Member Functions | |
| GADefineIdentity ("GA1DBinaryStringGenome", GAID::BinaryStringGenome) | |
| GA1DBinaryStringGenome (unsigned int len, GAGenome::Evaluator f=nullptr, void *u=nullptr) | |
| GA1DBinaryStringGenome (const GA1DBinaryStringGenome &orig) | |
| GA1DBinaryStringGenome & | operator= (const GAGenome &arg) |
| GA1DBinaryStringGenome & | operator= (const short array[]) |
| GA1DBinaryStringGenome & | operator= (const int array[]) |
| GAGenome * | clone (GAGenome::CloneMethod flag=CloneMethod::CONTENTS) const override |
| void | copy (const GAGenome &) override |
| int | read (std::istream &is) override |
| int | write (std::ostream &os) const override |
| bool | equal (const GAGenome &c) const override |
| short | gene (unsigned int x=0) const |
| short | gene (unsigned int x, short value) |
| short | operator[] (unsigned int x) |
| int | length () const |
| int | length (int x) |
| int | resize (int l) |
| int | resizeBehaviour () const |
| int | resizeBehaviour (unsigned int lower, unsigned int upper) |
| void | copy (const GA1DBinaryStringGenome &orig, unsigned int r, unsigned int x, unsigned int length) |
| bool | equal (const GA1DBinaryStringGenome &orig, unsigned int r, unsigned int x, unsigned int length) const |
| void | set (unsigned int x, unsigned int length) |
| void | unset (unsigned int x, unsigned int length) |
| void | randomize (unsigned int x, unsigned int length) |
| void | randomize () |
| void | move (unsigned int destx, unsigned int srcx, unsigned int length) |
Public Member Functions inherited from GABinaryString | |
| 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 () |
Public Member Functions inherited from GAGenome | |
| 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 |
Public Member Functions inherited from GAID | |
| 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 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 int | TwoPointCrossover (const GAGenome &, const GAGenome &, GAGenome *, GAGenome *) |
| static float | BitComparator (const GAGenome &, const GAGenome &) |
Static Public Member Functions inherited from GAGenome | |
| static void | NoInitializer (GAGenome &) |
| static int | NoMutator (GAGenome &, float) |
| static float | NoComparator (const GAGenome &, const GAGenome &) |
Protected Attributes | |
| unsigned int | nx |
| unsigned int | minX |
| unsigned int | maxX |
Protected Attributes inherited from GABinaryString | |
| std::vector< GABit > | data |
| the data themselves | |
Protected Attributes inherited from GAGenome | |
| 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 | |
Public Types inherited from GAGenome | |
| 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 *) |
Public Types inherited from GAID | |
| 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 } |
Interface for the 1D binary string genome, including crossover objects and all the default and built-in operators.