Adds custom node function to the set of functions stored by a parameters structure.
DLL_EXPORT void addCustomNodeFunction( struct parameters * params, double (*function)(const int numInputs, const double *inputs, const double *weights), char const * functionName, int maxNumInputs )
Adds pre-defined node function(s) to the set of functions stored by a parameters structure.
DLL_EXPORT void addNodeFunction( struct parameters * params, char const * functionNames )
Stores a CGP chromosome instances used by the CGP-Library.
struct chromosome
Resets the function set stored by a parameters structure to contain no functions.
DLL_EXPORT void clearFunctionSet( struct parameters * params )
Copies the contents of one chromoosme into the other.
DLL_EXPORT void copyChromosome( struct chromosome * chromoDest, struct chromosome * chromoSrc )
Stores a data set which can be used by fitness functions when calculating a chromosomes fitness.
struct dataSet
Executes the given chromosome.
DLL_EXPORT void executeChromosome( struct chromosome * chromo, const double * inputs )
Frees chromosome instance.
DLL_EXPORT void freeChromosome( struct chromosome * chromo )
Frees dataSet instance.
DLL_EXPORT void freeDataSet( struct dataSet * data )
Frees parameters structure instance.
DLL_EXPORT void freeParameters( struct parameters * params )
Frees results instance.
DLL_EXPORT void freeResults( struct results * rels )
Gets the average number of active nodes of the best chromosome found for each run in results.
DLL_EXPORT double getAverageActiveNodes( struct results * rels )
Gets the average fitness of the best chromosome found for each run in results.
DLL_EXPORT double getAverageFitness( struct results * rels )
Gets the average number generations required to find the best best chromosome for each run in results.
DLL_EXPORT double getAverageGenerations( struct results * rels )
Gets a copy of the best chromosome found on the given run in an initialised results structure.
DLL_EXPORT struct chromosome* getChromosome( struct results * rels, int run )
Gets the fitness of the given chromosome
DLL_EXPORT double getChromosomeFitness( struct chromosome * chromo )
Gets the number of generations for which the given chromosome has been trained.
DLL_EXPORT int getChromosomeGenerations( struct chromosome * chromo )
Gets the arity of the chromosome nodes
DLL_EXPORT int getChromosomeNodeArity( struct chromosome * chromo, int index )
Gets the node value of the given chromosome and node after it has been executed using executeChromosome.
DLL_EXPORT double getChromosomeNodeValue( struct chromosome * chromo, int node )
Gets the outputs of the given chromosome after it has been executed using executeChromosome.
DLL_EXPORT double getChromosomeOutput( struct chromosome * chromo, int output )
Gets the dataSet input for the given sample index and input index.
DLL_EXPORT double getDataSetSampleInput( struct dataSet * data, int sample, int input )
Gets the dataSet inputs for the given sample index.
DLL_EXPORT double *getDataSetSampleInputs( struct dataSet * data, int sample )
Gets the dataSet output for the given sample index and output index.
DLL_EXPORT double getDataSetSampleOutput( struct dataSet * data, int sample, int output )
Gets the dataSet outputs for the given sample index.
DLL_EXPORT double *getDataSetSampleOutputs( struct dataSet * data, int sample )
Gets the median number of active nodes of the best chromosome found for each run in results.
DLL_EXPORT double getMedianActiveNodes( struct results * rels )
Gets the median fitness of the best chromosome found for each run in results.
DLL_EXPORT double getMedianFitness( struct results * rels )
Gets the median number generations required to find the best best chromosome for each run in results.
DLL_EXPORT double getMedianGenerations( struct results * rels )
Gets the number of active connections in the given chromosome
DLL_EXPORT int getNumChromosomeActiveConnections( struct chromosome * chromo )
Gets the number of chromosome active nodes
DLL_EXPORT int getNumChromosomeActiveNodes( struct chromosome * chromo )
Gets the number of chromosome inputs
DLL_EXPORT int getNumChromosomeInputs( struct chromosome * chromo )
Gets the number of chromosome nodes
DLL_EXPORT int getNumChromosomeNodes( struct chromosome * chromo )
Gets the number of chromosome outputs
DLL_EXPORT int getNumChromosomeOutputs( struct chromosome * chromo )
Gets number of chromosomes stored in the given results structure.
DLL_EXPORT int getNumChromosomes( struct results * rels )
Gets the number of dataSet inputs.
DLL_EXPORT int getNumDataSetInputs( struct dataSet * data )
Gets the number of dataSet outputs.
DLL_EXPORT int getNumDataSetOutputs( struct dataSet * data )
Gets the number of samples in the given dataSet.
DLL_EXPORT int getNumDataSetSamples( struct dataSet * data )
Initialises a chromosome based on the given parameters.
DLL_EXPORT struct chromosome *initialiseChromosome( struct parameters * params )
Initialises a chromosome from a given chromosome.
DLL_EXPORT struct chromosome *initialiseChromosomeFromChromosome( struct chromosome * chromo )
Initialises a chromosome from a given previously saved chromosome.
DLL_EXPORT struct chromosome* initialiseChromosomeFromFile( char const * file )
Initialises a dataSet structures using the given input output pairs.
DLL_EXPORT struct dataSet *initialiseDataSetFromArrays( int numInputs, int numOutputs, int numSamples, double * inputs, double * outputs )
Initialises a dataSet structures using the given file.
DLL_EXPORT struct dataSet *initialiseDataSetFromFile( char const * file )
Initialises a parameters structure used throughout the CGP-Library.
DLL_EXPORT struct parameters *initialiseParameters( const int numInputs, const int numNodes, const int numOutputs, const int arity )
Returns whether the given node in the given chromosome is active.
DLL_EXPORT int isNodeActive( struct chromosome * chromo, int node )