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
A
 About
 addCustomNodeFunction
 addNodeFunction
 API
 Author
 Average Behaviour
C
 Cartesian Genetic Programming
 CGP Functions
 CGP-Library
 CGP-Library Documentation
 chromosome
 Chromosome Functions
 Citations
 clearFunctionSet
 Contact
 copyChromosome
 Creating Data Sets
 Custom Fitness Function
 Custom Node Functions
 Custom Reproduction Scheme
 Custom Selection Scheme
D
 dataSet
 DataSet Functions
 Download
E
 Evolutionary Algorithms
 executeChromosome
F
 freeChromosome
 freeDataSet
 freeParameters
 freeResults
 Functions
G
 getAverageActiveNodes
 getAverageFitness
 getAverageGenerations
 getChromosome
 getChromosomeFitness
 getChromosomeGenerations
 getChromosomeNodeArity
 getChromosomeNodeValue
 getChromosomeOutput
 getDataSetSampleInput
 getDataSetSampleInputs
 getDataSetSampleOutput
 getDataSetSampleOutputs
 getMedianActiveNodes
 getMedianFitness
 getMedianGenerations
 getNumChromosomeActiveConnections
 getNumChromosomeActiveNodes
 getNumChromosomeInputs
 getNumChromosomeNodes
 getNumChromosomeOutputs
 getNumChromosomes
 getNumDataSetInputs
 getNumDataSetOutputs
 getNumDataSetSamples
 Getting Started
I
 initialiseChromosome
 initialiseChromosomeFromChromosome
 initialiseChromosomeFromFile
 initialiseDataSetFromArrays
 initialiseDataSetFromFile
 initialiseParameters
 Installation
 isNodeActive
CGP-Library is a cross platform Cartesian Genetic Programming implementation designed to be simple to use whilst being highly extendable.
DLL_EXPORT void addCustomNodeFunction(
   struct parameters *params,
   double (*function)(const int numInputs, const double *inputs, const double *weights),
   char const *functionName,
   int maxNumInputs
)
Adds custom node function to the set of functions stored by a parameters structure.
DLL_EXPORT void addNodeFunction(struct parameters *params,
char const *functionNames)
Adds pre-defined node function(s) to the set of functions stored by a parameters structure.
Description of all the CGP-Library functions and structures.
Andrew James Turner
This tutorial introduces the use of repeatCGP to assess the average behaviour of CGP towards a given application rather than a one-off instance.
Cartesian Genetic Programming (CGP) is a form of Genetic Programming (GP) which is itself an Evolutionary Algorithm (EA).
Copyright © Andrew James Turner 2016, andrew.nosp@m..turner@york..nosp@m.ac.uk
Copyright © Andrew James Turner 2016, andrew.nosp@m..turner@york..nosp@m.ac.uk
struct chromosome
Stores a CGP chromosome instances used by the CGP-Library.
Description of all functions and structures relating to chromosomes
If the CGP-Library is ever used in published work it would be greatly appreciated if a citation were made to the following journal letter.
DLL_EXPORT void clearFunctionSet(struct parameters *params)
Resets the function set stored by a parameters structure to contain no functions.
Bugs, clarification and feature requests can be sent to author, see above.
DLL_EXPORT void copyChromosome(struct chromosome *chromoDest,
struct chromosome *chromoSrc)
Copies the contents of one chromoosme into the other.
This tutorial demonstrates how to create the files used by initialiseDataSetFromFile to initialise dataSet structures.
This tutorial introduces how to use a custom fitness functions with the CGP-Library.
This tutorial introduces how to use custom node transfer functions not provided by the CGP-Library.
This tutorial introduces the use of custom reproduction schemes.
This tutorial introduces the use of custom selection schemes.
struct dataSet
Stores a data set which can be used by fitness functions when calculating a chromosomes fitness.
Description of all functions and structures relating to data sets
The current and previous versions of CGP-Library will be available here for download.
Evolutionary Algorithms are a superset of CGP.
DLL_EXPORT void executeChromosome(struct chromosome *chromo,
const double *inputs)
Executes the given chromosome.
DLL_EXPORT void freeChromosome(struct chromosome *chromo)
Frees chromosome instance.
DLL_EXPORT void freeDataSet(struct dataSet *data)
Frees dataSet instance.
DLL_EXPORT void freeParameters(struct parameters *params)
Frees parameters structure instance.
DLL_EXPORT void freeResults(struct results *rels)
Frees results instance.
DLL_EXPORT double getAverageActiveNodes(struct results *rels)
Gets the average number of active nodes of the best chromosome found for each run in results.
DLL_EXPORT double getAverageFitness(struct results *rels)
Gets the average fitness of the best chromosome found for each run in results.
DLL_EXPORT double getAverageGenerations(struct results *rels)
Gets the average number generations required to find the best best chromosome for each run in results.
DLL_EXPORT struct chromosome* getChromosome(struct results *rels,
int run)
Gets a copy of the best chromosome found on the given run in an initialised results structure.
DLL_EXPORT double getChromosomeFitness(struct chromosome *chromo)
Gets the fitness of the given chromosome
DLL_EXPORT int getChromosomeGenerations(struct chromosome *chromo)
Gets the number of generations for which the given chromosome has been trained.
DLL_EXPORT int getChromosomeNodeArity(struct chromosome *chromo,
int index)
Gets the arity of the chromosome nodes
DLL_EXPORT double getChromosomeNodeValue(struct chromosome *chromo,
int node)
Gets the node value of the given chromosome and node after it has been executed using executeChromosome.
DLL_EXPORT double getChromosomeOutput(struct chromosome *chromo,
int output)
Gets the outputs of the given chromosome after it has been executed using executeChromosome.
DLL_EXPORT double getDataSetSampleInput(struct dataSet *data,
int sample,
int input)
Gets the dataSet input for the given sample index and input index.
DLL_EXPORT double *getDataSetSampleInputs(struct dataSet *data,
int sample)
Gets the dataSet inputs for the given sample index.
DLL_EXPORT double getDataSetSampleOutput(struct dataSet *data,
int sample,
int output)
Gets the dataSet output for the given sample index and output index.
DLL_EXPORT double *getDataSetSampleOutputs(struct dataSet *data,
int sample)
Gets the dataSet outputs for the given sample index.
DLL_EXPORT double getMedianActiveNodes(struct results *rels)
Gets the median number of active nodes of the best chromosome found for each run in results.
DLL_EXPORT double getMedianFitness(struct results *rels)
Gets the median fitness of the best chromosome found for each run in results.
DLL_EXPORT double getMedianGenerations(struct results *rels)
Gets the median number generations required to find the best best chromosome for each run in results.
DLL_EXPORT int getNumChromosomeActiveConnections(struct chromosome *chromo)
Gets the number of active connections in the given chromosome
DLL_EXPORT int getNumChromosomeActiveNodes(struct chromosome *chromo)
Gets the number of chromosome active nodes
DLL_EXPORT int getNumChromosomeInputs(struct chromosome *chromo)
Gets the number of chromosome inputs
DLL_EXPORT int getNumChromosomeNodes(struct chromosome *chromo)
Gets the number of chromosome nodes
DLL_EXPORT int getNumChromosomeOutputs(struct chromosome *chromo)
Gets the number of chromosome outputs
DLL_EXPORT int getNumChromosomes(struct results *rels)
Gets number of chromosomes stored in the given results structure.
DLL_EXPORT int getNumDataSetInputs(struct dataSet *data)
Gets the number of dataSet inputs.
DLL_EXPORT int getNumDataSetOutputs(struct dataSet *data)
Gets the number of dataSet outputs.
DLL_EXPORT int getNumDataSetSamples(struct dataSet *data)
Gets the number of samples in the given dataSet.
This tutorial introduces and steps through a simple program which uses the CGP-Library to solve a symbolic regression problem.
DLL_EXPORT struct chromosome *initialiseChromosome(struct parameters *params)
Initialises a chromosome based on the given parameters.
DLL_EXPORT struct chromosome *initialiseChromosomeFromChromosome(
   struct chromosome *chromo
)
Initialises a chromosome from a given chromosome.
DLL_EXPORT struct chromosome* initialiseChromosomeFromFile(char const *file)
Initialises a chromosome from a given previously saved chromosome.
DLL_EXPORT struct dataSet *initialiseDataSetFromArrays(int numInputs,
int numOutputs,
int numSamples,
double *inputs,
double *outputs)
Initialises a dataSet structures using the given input output pairs.
DLL_EXPORT struct dataSet *initialiseDataSetFromFile(char const *file)
Initialises a dataSet structures using the given file.
DLL_EXPORT struct parameters *initialiseParameters(const int numInputs,
const int numNodes,
const int numOutputs,
const int arity)
Initialises a parameters structure used throughout the CGP-Library.
First download the latest CGP-Library from Download and unzip the file.
DLL_EXPORT int isNodeActive(struct chromosome *chromo,
int node)
Returns whether the given node in the given chromosome is active.
Close