Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
L
 Licenses
M
 Manipulating Chromosomes
 Multiple Threads
 mutateChromosome
N
 NeuroEvolution
 News
O
 Open Source
 Other
P
 parameters
 Parameters Functions
 printChromosome
 printDataSet
 printParameters
R
 Recurrent Connections
 References
 removeInactiveNodes
 repeatCGP
 resetChromosome
 results
 Results Functions
 runCGP
S
 saveChromosome
 saveChromosomeDot
 saveChromosomeLatex
 saveDataSet
 saveResults
 setArity
 setChromosomeFitness
 setConnectionWeightRange
 setCustomFitnessFunction
 setCustomReproductionScheme
 setCustomSelectionScheme
 setEvolutionaryStrategy
 setLambda
 setMu
 setMutationRate
 setMutationType
 setNumInputs
 setNumNodes
 setNumOutputs
 setNumThreads
 setRandomNumberSeed
 setRecurrentConnectionProbability
 setShortcutConnections
 setTargetFitness
 setUpdateFrequency
 Stepping Through the Code
 Structures
CGP-Library is an open source project intended to be useful for many applications.
This tutorial introduces some of the operations which can be used to manipulate individual CGP chromosomes.
This tutorial introduces and steps through a simple program which instructs the CGP-Library to use multiple threads.
DLL_EXPORT void mutateChromosome(struct parameters *params,
struct chromosome *chromo)
Mutate the given chromosome using the mutation method described in the given parameters.
This tutorial introduces using the CGP-Library as a NeuroEvolutionary training method.
CGP-Lirary 2.4 has been released!  Grab this latest version from the Downloads page.
CGP-Library is an open source project released under the GNU Lesser General Public License.
struct parameters
Stores general evolutionary and chromosome parameters used by the CGP-Library.
Description of all the functions related to CGP-Library parameters
DLL_EXPORT void printChromosome(struct chromosome *chromo,
int weights)
Displays the given chromosome to the terminal / command prompt in a human readable format.
DLL_EXPORT void printDataSet(struct dataSet *data)
Prints the input output pairs held by a dataSet structure to the terminal.
DLL_EXPORT void printParameters(struct parameters *params)
Prints the given parameters to the screen in a human readable format.
This tutorial introduces using the CGP-Library to create recurrent programs.
Much of the CGP-Library is based on published peer reviewed academic research.
DLL_EXPORT void removeInactiveNodes(struct chromosome *chromo)
Removes all of the inactive nodes from the given chromosome.
DLL_EXPORT struct results* repeatCGP(struct parameters *params,
struct dataSet *data,
int numGens,
int numRuns)
Repeatedly applies CGP to the given task.
DLL_EXPORT void resetChromosome(struct chromosome *chromo)
Resets all of the chromosome nodes to output zero.
struct results
Stores the best chromosome found on each run when using repeatCGP
DLL_EXPORT struct chromosome* runCGP(struct parameters *params,
struct dataSet *data,
int numGens)
Applies CGP to the given task.
DLL_EXPORT void saveChromosome(struct chromosome *chromo,
char const *fileName)
Saves the given chromosome to a file which can used to initialise new chromosomes.
DLL_EXPORT void saveChromosomeDot(struct chromosome *chromo,
int weights,
char const *fileName)
Saves the given chromosome to a graphviz .dot file.
DLL_EXPORT void saveChromosomeLatex(struct chromosome *chromo,
int weights,
char const *fileName)
Saves the given chromosome to a latex .tex file for visulisation and inclusion in written workes.
DLL_EXPORT void saveDataSet(struct dataSet *data,
char const *fileName)
Saves the given dataSet to a file which can be read using initialiseDataSetFromFile.
DLL_EXPORT void saveResults(struct results *rels,
char const *fileName)
Saves the given results to a csv file.
DLL_EXPORT void setArity(struct parameters *params,
int arity)
Sets the arity of the chromosome nodes in the given parameters.
DLL_EXPORT void setChromosomeFitness(struct parameters *params,
struct chromosome *chromo,
struct dataSet *data)
Sets the fitness of the chromosome using the fitness function given in the parameters
DLL_EXPORT void setConnectionWeightRange(struct parameters *params,
double weightRange)
Sets the connection weight range in the given parameters.
DLL_EXPORT void setCustomFitnessFunction(
   struct parameters *params,
   double (*fitnessFunction)(struct parameters *params, struct chromosome *chromo, struct dataSet *data),
   char const *fitnessFunctionName
)
Set custom fitness function.
DLL_EXPORT void setCustomReproductionScheme(
   struct parameters *params,
   void (*reproductionScheme)(struct parameters *params, struct chromosome **parents, struct chromosome **children, int numParents, int numChildren),
   char const *reproductionSchemeName
)
Sets custom reproduction scheme.
DLL_EXPORT void setCustomSelectionScheme(
   struct parameters *params,
   void (*selectionScheme)(struct parameters *params, struct chromosome **parents, struct chromosome **candidateChromos, int numParents, int numCandidateChromos),
   char const *selectionSchemeName
)
Sets custom selection scheme.
DLL_EXPORT void setEvolutionaryStrategy(struct parameters *params,
char evolutionaryStrategy)
Sets the evolutionary strategy in the given parameters.
DLL_EXPORT void setLambda(struct parameters *params,
int lambda)
Sets the lambda value in the given parameters.
DLL_EXPORT void setMu(struct parameters *params,
int mu)
Sets the mu value in the given parameters.
DLL_EXPORT void setMutationRate(struct parameters *params,
double mutationRate)
Sets the mutation rate in the given parameters.
DLL_EXPORT void setMutationType(struct parameters *params,
char const *mutationType)
Sets the mutation method used when mutating chromosomes.
DLL_EXPORT void setNumInputs(struct parameters *params,
int numInputs)
Sets the number of chromosome inputs in the given parameters.
DLL_EXPORT void setNumNodes(struct parameters *params,
int numNodes)
Sets the number of chromosome nodes in the given parameters.
DLL_EXPORT void setNumOutputs(struct parameters *params,
int numOutputs)
Sets the number of chromosome outputs in the given parameters.
DLL_EXPORT void setNumThreads(struct parameters *params,
int numThreads)
Sets the number of threads in the given parameters.
DLL_EXPORT void setRandomNumberSeed(unsigned int seed)
Sets the seed used by the random number generator in CGP-Library.
DLL_EXPORT void setRecurrentConnectionProbability(
   struct parameters *params,
   double recurrentConnectionProbability
)
Sets the recurrent connection probability in the given parameters.
DLL_EXPORT void setShortcutConnections(struct parameters *params,
int shortcutConnections)
Sets whether shortcut connections are used in the given parameters.
DLL_EXPORT void setTargetFitness(struct parameters *params,
double targetFitness)
Sets the target fitness used when running CGP.
DLL_EXPORT void setUpdateFrequency(struct parameters *params,
int updateFrequency)
Sets the frequency of the updates to the user when using runCGP.
A close look at the code.
Description of all the structures used by CGP-Library.
Close