Modernized GAlib
3.0.0 current
|
#include <GAListGenome.hpp>
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) |
GAGenome * | clone (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) |
![]() | |
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) |
![]() | |
GAListBASE (GANodeBASE *n) | |
int | size () const |
![]() | |
GADefineIdentity ("GAGenome", GAID::Genome) | |
GAGenome (Initializer i=nullptr, Mutator m=nullptr, Comparator c=nullptr) | |
GAGenome (const GAGenome &orig) | |
GAGenome & | operator= (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) |
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 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 void | NoInitializer (GAGenome &) |
static int | NoMutator (GAGenome &, float) |
static float | NoComparator (const GAGenome &, const GAGenome &) |
Additional Inherited Members | |
![]() | |
enum | Location { HEAD = 0 , TAIL , BEFORE , AFTER } |
enum | { NO_ERR = 0 , ERR = -1 } |
![]() | |
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 } |
![]() | |
int | insert (GANode< T > *n, GANode< T > *idx, GAListBASE::Location where=GAListBASE::AFTER) |
![]() | |
GANodeBASE * | remove (GANodeBASE *n) |
int | insert (GANodeBASE *n, GANodeBASE *idx, Location where=AFTER) |
int | swapnode (GANodeBASE *a, GANodeBASE *b) |
![]() | |
GAListIter< T > | iter |
![]() | |
int | sz |
int | csz |
GANodeBASE * | hd |
![]() | |
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 |