Skip to content
Richard Preen edited this page Jan 30, 2022 · 20 revisions

Directory Structure

  • build empty folder to be used for building executables
  • cfg contains configuration files for initialising parameters for the stand-alone executable
  • doc contains files for generating Doxygen documentation
  • env contains data files for problem environments
  • lib contains third-party libraries for random number generation, unit testing, pybind, etc.
  • python contains example Python scripts
  • python/notebooks contains jupyter notebook examples
  • test contains unit tests
  • xcsf contains XCSF source code
  • xcsf/utils contains Python utilities for visualisation, etc.

Doxygen + graphviz

To build locally see Compiling and Running.

The github-pages contains prebuilt documentation, including:

Parameters

The main data structure XCSF located within xcsf.h is passed to almost all functions, enabling access to parameters. This structure directly contains general parameters, e.g., double BETA; which can be accessed with xcsf->BETA. It also contains sub-structures containing groups of parameters, e.g., for the EA with struct ArgsEA *ea;

The sub-structures containing groups of parameters are:

  • Condition parameters defined within struct ArgsCond located within condition.h.
  • Action parameters defined within struct ArgsAct located within action.h.
  • Prediction parameters defined within struct ArgsPred located within prediction.h.
  • EA parameters defined within struct ArgsEA located within ea.h.

Every parameter needs the following tasks implemented:

  1. setting the parameter value - this provides a single point at which the values change and minimums and maximums can be defined to help users and avoid undefined behaviour;
  2. setting the default parameter value;
  3. exporting the parameter as a JSON formatted string;
  4. importing the parameter with a JSON string;
  5. printing the parameter value (using the JSON export function);
  6. saving the parameter value to persistent storage;
  7. loading the parameter value from persistent storage;

These functions for general parameters are defined within param.c. For the above-mentioned sub-structures, the functions are located within the respective *.c files. These can then be accessed through the XCSF structure, e.g., xcsf->cond->bits.

Finally, to enable the parameters to be set by Python, they may also need to be added to pybind_wrapper.cpp.

Clone this wiki locally