GeneticAlgoithm
Implementation of the genetic algorithm
Functions
Demo Program

Demo Program. More...

Functions

int main (int argc, char **argv)
 Main function. More...
 
void parseCommandLine (Config &config, int argc, char **argv)
 Prase command line arguments. More...
 

Detailed Description

Demo Program.

Objective: Use the Genetic Algorithm to fit a gaussian probability density function to a data distribution.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Main function.

This program performs the following tasks:

  • Parse the command line and defines configuration.
  • Generates a dataset following a gaussian distribution.
  • Fits the generated distribution using ROOT's implementation.
  • Fits the generated distribution using our GA implementation.
    • Perform some tests about the behavior of our GA algorithm.
  • Plot the results of the main algorithm and the tests.

Full documentation of the algorithms is available in Genetic Algorithm.

Parameters
argcNumber of command line arguments.
argvArray of command line arguments.
Returns
0 upon successfull exit

Definition at line 54 of file runGA.cxx.

◆ parseCommandLine()

void parseCommandLine ( Config &  config,
int  argc,
char **  argv 
)

Prase command line arguments.

Parameters
configConfiguration to parse into.
argcNumber of command line arguments.
argvArray of command line arguments.

Configuration details:

  • -n, --nmc Number of toy MC experiments used to build the dataset.
  • -m, --mean Mean of the gaussian distribution used to generate the dataset.
  • -s, --sigma Width (sigma) of the gaussian distribution used to generate the dataset.
  • -a, --acceptThreshold Score threshold to accept a model as a final answer.
  • -R, --mutateRate Rate at which models are subjected to mutation.
  • -S, --mutateSize Relative size of the mutation whenever applied.
  • -G, --maxGenerations Maximum number of generations before aborting the optimization loop.
  • -N, --populationSize Size of the population to be evolved.
  • -t, --runTests Run tests alongside the main algorithm.

Definition at line 254 of file runGA.cxx.