libfgen  0.1.15
Library for optimization using a genetic algorithm or particle swarm optimization
Public Member Functions | Friends

Public Member Functions

FGEN_API void Initialize (int population_size, int individual_size_in_bits, int data_element_size)
FGEN_API void Destroy ()
virtual FGEN_API void GenerationCallback (int generation)
virtual FGEN_API double CalculateFitness (const unsigned char *bitstring)
virtual FGEN_API void Seed (unsigned char *bitstring)
virtual FGEN_API void Mutate (const unsigned char *parent, unsigned char *child)
virtual FGEN_API void Crossover (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void SeedBitstringRandom (unsigned char *bitstring)
FGEN_API void MutatePerBitPlusMacroMutation (const unsigned char *parent, unsigned char *child)
FGEN_API void MutatePerBit (const unsigned char *parent, unsigned char *child)
FGEN_API void CrossoverOnePointPerBit (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverTwoPointPerBit (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverOnePointPerElement (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverTwoPointPerElement (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverUniformPerBit (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverUniformPerElement (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverNoop (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void SeedPermutationRandom (unsigned char *bitstring)
FGEN_API void MutatePermutationSwap (const unsigned char *parent, unsigned char *child)
FGEN_API void MutatePermutationInsert (const unsigned char *parent, unsigned char *child)
FGEN_API void MutatePermutationInvert (const unsigned char *parent, unsigned char *child)
FGEN_API void CrossoverPermutationOrderBased (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void CrossoverPermutationPositionBased (const unsigned char *parent1, const unsigned char *parent2, unsigned char *child1, unsigned char *child2)
FGEN_API void SetParameters (int selection_type, int selection_fitness_type, float crossover_probability_float, float mutation_per_bit_probability_float, float macro_mutation_probability_float)
FGEN_API void Run (int max_generation)
FGEN_API void RunThreaded (int max_generation)
FGEN_API void RunSteadyState (int max_generation)
FGEN_API void SetMutationProbability (float prob)
FGEN_API void SetMacroMutationProbability (float prob)
FGEN_API void SetCrossoverProbability (float prob)
FGEN_API void SetSelectionFitnessType (int type)
FGEN_API void SetSelectionType (int type)
FGEN_API void SetTournamentSize (int size)
FGEN_API void SetDataElementSize (int size)
FGEN_API void SetNumberOfElites (int n)
FGEN_API void SetPermutationSize (int size)
FGEN_API void SetMigrationInterval (int interval)
FGEN_API void SetMigrationProbability (float prob)
FGEN_API void SetGenerationCallbackInterval (int interval)
FGEN_API FgenppIndividualBestIndividual ()
FGEN_API FgenppIndividualWorstIndividual ()
FGEN_API void UpdateFitness ()
FGEN_API void SignalStop ()
FGEN_API FgenRNGGetRNG ()
FGEN_API int GetIndividualSizeInBytes ()
FGEN_API int GetIsland ()

Friends

class FgenppArchipelago

Detailed Description

Definition at line 48 of file fgenpp.h.


Member Function Documentation

void FgenppPopulation::Initialize ( int  population_size,
int  individual_size_in_bits,
int  data_element_size 
)

Initialize an FgenppPopulation. This does the same things as fgen_create(). The FgenppPopulation must be instantiated.

Definition at line 181 of file fgenpp.cpp.

Destroy data structures associated with a population. The FgenppPopulation class itself is not deallocated.

Definition at line 201 of file fgenpp.cpp.

void FgenppPopulation::GenerationCallback ( int  generation) [virtual]

The generation callback method. Usually overridden in a derived sub-class.

Definition at line 59 of file fgenpp.cpp.

double FgenppPopulation::CalculateFitness ( const unsigned char *  bitstring) [virtual]

The calculate error method. The default one does nothing. It must be overridden by a derived sub-class.

Definition at line 68 of file fgenpp.cpp.

void FgenppPopulation::Seed ( unsigned char *  bitstring) [virtual]

The seed method. The default is the random bitstring seeding operator SeedBitstringRandom. Can be overridden by a derived sub-class.

Definition at line 76 of file fgenpp.cpp.

void FgenppPopulation::Mutate ( const unsigned char *  parent,
unsigned char *  child 
) [virtual]

The mutate method. The default is mutation per bit plus macro mutation for bitstring (MutatePerBitPlusMacroMutation). Can be overridden by a derived sub-class.

Definition at line 85 of file fgenpp.cpp.

void FgenppPopulation::Crossover ( const unsigned char *  parent1,
const unsigned char *  parent2,
unsigned char *  child1,
unsigned char *  child2 
) [virtual]

The crossover method. The default is two-point bitwise crossover for bitstrings (CrossoverTwoPointPerBit). Can be overridden in a derived sub-class.

Definition at line 94 of file fgenpp.cpp.

 All Data Structures Functions Variables