Modernized GAlib  3.0.0 current
Public Member Functions | Static Public Member Functions | List of all members
GAListGenome< T > Class Template Reference

GAListGenome. More...

#include <GAListGenome.hpp>

Inheritance diagram for GAListGenome< T >:
[legend]
Collaboration diagram for GAListGenome< T >:
[legend]

Public Member Functions

 GADefineIdentity ("GAListGenome", GAID::ListGenome)
 
 GAListGenome (GAGenome::Evaluator f=nullptr, void *u=nullptr)
 
 GAListGenome (const GAListGenome< T > &orig)
 
GAListGenome< T > & operator= (const GAGenome &orig)
 
GAGenomeclone (GAGenome::CloneMethod flag=CloneMethod::CONTENTS) const override
 
void copy (const GAGenome &orig) override
 
int write (std::ostream &os) const override
 
bool equal (const GAGenome &c) const override
 
int destroy ()
 
int swap (unsigned int i, unsigned int j)
 
T * remove ()
 
int insert (GAList< T > *t, GAListBASE::Location where=GAListBASE::AFTER)
 
int insert (const T &t, GAListBASE::Location where=GAListBASE::AFTER)
 
- Public Member Functions inherited from GAList< T >
 GAList (const T &t)
 
 GAList (const GAList< T > &orig)
 
GAList< T > & operator= (const GAList< T > &orig)
 
GAList< T > * clone (unsigned int i=0) const
 Make a copy of a list and return the pointer to the new list. More...
 
void copy (const GAList< T > &orig)
 Make a complete copy of the list and return a pointer to the new list. More...
 
int destroy ()
 Remove the current node from the list and free the memory it was using. More...
 
int swap (unsigned int a, unsigned int b)
 Swap two nodes in the list. More...
 
T * remove ()
 Remove the current node from the list. More...
 
int insert (GAList< T > *t, GAListBASE::Location where=GAListBASE::AFTER)
 Inserts the contents of list in to the current list and removes it from the original list. More...
 
int insert (const T &t, GAListBASE::Location where=GAListBASE::AFTER)
 Insert the object into the list at the specified place relative to the current location of the embedded iterator. More...
 
T * head ()
 
T * tail ()
 
T * current ()
 
T * next ()
 
T * prev ()
 
T * warp (unsigned int i)
 
T * warp (const GAListIter< T > &i)
 
T * operator[] (unsigned int i)
 
- Public Member Functions inherited from GAListBASE
 GAListBASE (GANodeBASE *n)
 
int size () 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 SwapMutator (GAGenome &c, float pmut)
 
static float NodeComparator (const GAGenome &a, const GAGenome &b)
 
static int OnePointCrossover (const GAGenome &p1, const GAGenome &p2, GAGenome *c1, GAGenome *c2)
 
static int PartialMatchCrossover (const GAGenome &p1, const GAGenome &p2, GAGenome *c1, GAGenome *c2)
 
static int OrderCrossover (const GAGenome &p1, const GAGenome &p2, GAGenome *c1, GAGenome *c2)
 
static int CycleCrossover (const GAGenome &p1, const GAGenome &p2, GAGenome *c1, GAGenome *c2)
 
- 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 GAListBASE
enum  Location { HEAD = 0 , TAIL , BEFORE , AFTER }
 
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 GAList< T >
int insert (GANode< T > *n, GANode< T > *idx, GAListBASE::Location where=GAListBASE::AFTER)
 
- Protected Member Functions inherited from GAListBASE
GANodeBASEremove (GANodeBASE *n)
 
int insert (GANodeBASE *n, GANodeBASE *idx, Location where=AFTER)
 
int swapnode (GANodeBASE *a, GANodeBASE *b)
 
- Protected Attributes inherited from GAList< T >
GAListIter< T > iter
 
- Protected Attributes inherited from GAListBASE
int sz
 
int csz
 
GANodeBASEhd
 
- 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
 

Detailed Description

template<class T>
class GAListGenome< T >

GAListGenome.


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