Modernized GAlib  3.0.0 current
Public Member Functions | Static Public Member Functions | List of all members
GATreeGenome< T > Class Template Reference
Inheritance diagram for GATreeGenome< T >:
[legend]
Collaboration diagram for GATreeGenome< T >:
[legend]

Public Member Functions

 GADefineIdentity ("GATreeGenome", GAID::TreeGenome)
 
 GATreeGenome (GAGenome::Evaluator f=nullptr, void *u=nullptr)
 
 GATreeGenome (const GATreeGenome< T > &orig)
 
GATreeGenome< T > & operator= (const GAGenome &orig)
 
GAGenomeclone (GAGenome::CloneMethod flag=CloneMethod::CONTENTS) const override
 
void copy (const GAGenome &orig) override
 
void _tt (std::ostream &os, GANode< T > *n)
 
int write (std::ostream &os) const override
 
bool equal (const GAGenome &c) const override
 
int destroy ()
 
int swaptree (GATree< T > *t)
 
int swaptree (unsigned int i, unsigned int j)
 
int swap (unsigned int i, unsigned int j)
 
GATree< T > * remove ()
 
int insert (GATree< T > *t, GATreeBASE::Location where=GATreeBASE::BELOW)
 
int insert (const T &t, GATreeBASE::Location where=GATreeBASE::BELOW)
 
- Public Member Functions inherited from GATree< T >
 GATree (const T &t)
 
 GATree (const GATree< T > &orig)
 
GATree< T > & operator= (const GATree< T > &orig)
 
GATree< T > * clone (unsigned int i=0) const
 
void copy (const GATree< T > &orig)
 
int destroy ()
 
int swaptree (GATree< T > *t)
 
int swaptree (unsigned int a, unsigned int b)
 
int swap (unsigned int a, unsigned int b)
 
GATree< T > * remove ()
 
int insert (GATree< T > *t, GATreeBASE::Location where=GATreeBASE::BELOW)
 
int insert (const T &t, GATreeBASE::Location where=GATreeBASE::BELOW)
 
T * root ()
 
T * current ()
 
T * next ()
 
T * prev ()
 
T * parent ()
 
T * child ()
 
T * eldest ()
 
T * youngest ()
 
T * warp (unsigned int i)
 
T * warp (const GATreeIter< T > &i)
 
int nchildren ()
 
int nsiblings ()
 
- Public Member Functions inherited from GATreeBASE
 GATreeBASE (GANodeBASE *n)
 
GANodeBASEremove (GANodeBASE *n)
 
int insert (GANodeBASE *n, GANodeBASE *idx, Location where=BELOW)
 
int swaptree (GANodeBASE *a, GANodeBASE *b)
 
int swapnode (GANodeBASE *a, GANodeBASE *b)
 
int size () const
 
int depth () const
 
int ancestral (unsigned int i, unsigned int j) const
 
- Public Member Functions inherited from GAGenome
 GADefineIdentity ("GAGenome", GAID::Genome)
 
 GAGenome (Initializer i=nullptr, Mutator m=nullptr, Comparator c=nullptr)
 
 GAGenome (const GAGenome &orig)
 
GAGenomeoperator= (const GAGenome &arg)
 
virtual int read (std::istream &)
 
virtual bool notequal (const GAGenome &g) const
 
int nevals () const
 
float score () const
 
float score (float s)
 
float fitness ()
 
float fitness (float f)
 
GAGeneticAlgorithmgeneticAlgorithm () const
 
GAGeneticAlgorithmgeneticAlgorithm (GAGeneticAlgorithm &g)
 
void * userData () const
 
void * userData (void *u)
 
GAEvalDataevalData () const
 
GAEvalDataevalData (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 int DestructiveMutator (GAGenome &c, float pmut)
 
static int SwapNodeMutator (GAGenome &c, float pmut)
 
static int SwapSubtreeMutator (GAGenome &c, float pmut)
 
static int OnePointCrossover (const GAGenome &p1, const GAGenome &p2, GAGenome *c1, GAGenome *c2)
 
static float TopologyComparator (const GAGenome &a, const GAGenome &b)
 
- Static Public Member Functions inherited from GAGenome
static void NoInitializer (GAGenome &)
 
static int NoMutator (GAGenome &, float)
 
static float NoComparator (const GAGenome &, const GAGenome &)
 

Additional Inherited Members

- Public Types inherited from GATreeBASE
enum  Location { ROOT = 0 , BEFORE , AFTER , BELOW }
 
enum  { NO_ERR = 0 , ERR = -1 }
 
- 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
}
 
- Protected Member Functions inherited from GATree< T >
int insert (GANode< T > *n, GANode< T > *idx, GATreeBASE::Location where=GATreeBASE::BELOW)
 
- Protected Attributes inherited from GATree< T >
GATreeIter< T > iter
 
- Protected Attributes inherited from GATreeBASE
int sz
 
int dpth
 
short csz
 
short cdpth
 
GANodeBASErt
 
- Protected Attributes inherited from GAGenome
float _score
 
float _fitness
 
bool _evaluated
 
unsigned int _neval
 
GAGeneticAlgorithmga
 
void * ud
 
Evaluator eval
 
GAEvalDataevd
 
Mutator mutr
 
Initializer init
 
Comparator cmp
 
SexualCrossover sexcross
 
AsexualCrossover asexcross
 

The documentation for this class was generated from the following file: