The current and previous versions of CGP-Library will be available here for download.

Version: 2.4

  • Added multiple thread support via openMP
  • Added getNumChromosomeActiveConnections
  • Fixed bug in the pow function
  • Wrapped cgp.h in an extern “C” for compatibility with c++ compilers

Date 29/04/16


Version: 2.3

  • Fixed bug where the number of inputs passed into a given node was always set to the max arity.
  • Fixed bug where it was possible (although unlikely) for a parent to be selected over a child even if they have equal fitness (due to using an unstable sort).
  • The index of nodes displayed using printChromosomes now match those displayed using saveChromosomeDot.

Date 01/09/15


Version 2.2

  • Now compiles with C++ compilers
  • Added CGP shortcut connections option.  See setShortcutConnections
  • Added functionality to get the current output value of chromosome nodes.  See getChromosomeNodeValue
  • Added functionality to query if a given chromosome node is active.  See isNodeActive
  • Additional data sets have been added to the default install including the majority of the Proben benchmarks; courtesy of Sam Pick.

Date: 23/06/15


Version 2.1

  • Added pi node function
  • Added 1 node function
  • Added 0 node function
  • Reduced the precession of connection weight values displayed using saveChromosomeDot to two decimal places.  Improves readability.
  • Replaced setFitnessFunction with setCustomFitnessFunction. setFitnessFunction is depreciated.
  • Replaced setSelectionScheme with setCustomSelectionScheme. setSelectionScheme is depreciated.
  • Replaced setReproductionScheme with setCustomReproductionScheme. setReproductionScheme is depreciated.
  • Replaced addNodeFunctionCustom with addCustomNodeFunction. addNodeFunctionCustom is depreciated.

Date: 09/10/14


Version 2.0

  • API CHANGE all float variables have been replaced by double for the extra position.
  • NEW FEATURE Recurrent Cartesian Genetic Programming (RCGP).  CGP-Library is now capable of creating programs/circuits/equations/neural networks which contain recurrent connections or feedback.
  • Fixed bug in sin function (it was calling cos... my bad)
  • Added mutation type “single”.
  • Added wire function to function set.

Date: 31/08/14


Version 1.1

  • FIXED SIGNIFICANT BUG in runCGP (incorrect chromosome was returned if a perfect solution was not found)
  • Added power function to function set.
  • Made graphviz contain more detail; including node number and connection number.

Date: 10/08/2014


Version 1.0

  • Initial non-beta release.

Date: 18/06/2014


Version 0.0 (beta)

  • Initial beta release of CGP-Library.

Date: 29/04/2014


DLL_EXPORT int getNumChromosomeActiveConnections(struct chromosome *chromo)
Gets the number of active connections in the given chromosome
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 saveChromosomeDot(struct chromosome *chromo,
int weights,
char const *fileName)
Saves the given chromosome to a graphviz .dot file.
DLL_EXPORT void setShortcutConnections(struct parameters *params,
int shortcutConnections)
Sets whether shortcut connections are used in the given parameters.
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 int isNodeActive(struct chromosome *chromo,
int node)
Returns whether the given node in the given chromosome is active.
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 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 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 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 struct chromosome* runCGP(struct parameters *params,
struct dataSet *data,
int numGens)
Applies CGP to the given task.