diff --git a/README.md b/README.md index 0992d30..5b9c9b1 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,15 @@ [![Build status](https://ci.appveyor.com/api/projects/status/eu0nns2dsgocwntw/branch/master?svg=true)](https://ci.appveyor.com/project/jakobbossek/ecr/branch/master) [![Coverage Status](https://coveralls.io/repos/jakobbossek/ecr/badge.svg)](https://coveralls.io/r/jakobbossek/ecr) -The **ecr** package provides a powerful framework for both single- and multi-objective **evolutionary algorithms** in R. It has build-in support for several standard genotypes like real-valued vectors, binary strings and permutations. Beside, different pre-defined **building blocks** in form of evolutionary operators (selectors, mutators, recombinators), e.g., k-Tournament-Selection, Gauss-Mutation, Crossover and many helper functions frequently needed in evolutionary algorithms are provided. The possibility to extend the available toolbox by defining new operators and even operate on non-standard representation makes the package very flexible. +The **ecr** package provides a powerful framework for implementing both single- and multi-objective **evolutionary algorithms** in R. It has build-in support for several standard genotypes like real-valued vectors, binary strings and permutations. Beside, different pre-defined **building blocks** in form of evolutionary operators (selectors, mutators, recombinators), e.g., k-tournament selection, Gaussian mutation, crossover and many helper functions frequently needed in evolutionary algorithms are provided. The possibility to extend the available toolbox by defining new operators and even operate on non-standard representations makes the package very flexible. ## Overview of Features * Optimization of single and multi-objective functions -* Build-in genotypes *float*, *binary*, and *permutation* and *custom*. The latter enables custom representations/genotypes -* Large collection of evolutionary operators -* Storing of the optimization process in an optimization path -* Methods to visualize results +* Build-in genotypes *float*, *binary*, and *permutation* and *custom*. The latter enables custom representations/genotypes. +* Large collection of predefined evolutionary operators for standard representations. +* Powerful and flexible monitoring/logging mechanism +* Event dispatching mechanism. For instance the user can register actions which should be called each time the population is updated. ## Installation Instructions @@ -28,7 +28,7 @@ devtools::install_github("jakobbossek/ecr") In this section we want to optimize a one dimensional function with an evolutionary algorithm using just the evolutionary operators shipped with the package. A more in-depth introduction will be available soon. -The [smoof](https://github.com/jakobbossek/smoof) R package provides a collection of different single objective test functions commonly used in algorithm benchmarking. As an example we are going to search for the global optimum of the one-dimensional *Rastrigin* function. +The [smoof](https://github.com/jakobbossek/smoof) R package provides a large collection of continuous single-objective test functions commonly used in benchmarking algorithms. As an example we are going to search for the global optimum of the one-dimensional *Rastrigin* function. ```splus library(smoof) @@ -36,12 +36,12 @@ library(ggplot2) library(ecr) obj.fun = makeRastriginFunction(dimensions = 1L) -autoplot(obj.fun) +autoplot(obj.fun, show.optimum = TRUE) ``` -As a next step we generate an ecr *control object*, which holds all the neccessary parameters for the evolutionary algorithm. The construction of this object needs consists of generating the object itself and kind of decorating it with some evolutionary operators. +As a next step we generate an ecr *control object*, which holds all the neccessary parameters for the evolutionary algorithm. The construction of this object consists of generating the object itself and kind of decorating it with some evolutionary operators. -For our setup we choose the *natural* representation with real-valued numbers as the genotype, a population size of 20 individuals with 5 individuals being created by recombination and mutation in each generation. Furthermore we decide to use a 'plus' survival strategy, i. e., the current population and the offspring will be merged before survival selection takes place. Gauss mutation with a standard deviance of 0.005 serves as the mutation operator and we keep the intermediate recombination operator (which is the default for representation float). Moreover we define a maximal number of 50 generations. +For our setup we choose the *natural* representation with real-valued numbers as the genotype, a population size of 20 individuals with 5 individuals being created by recombination and mutation in each generation. Furthermore we decide to use a 'plus' survival strategy, i. e., the current population and the offspring will be merged before survival selection takes place. Gauss mutation with a standard deviance of 0.005 serves as the mutation operator and we keep the intermediate recombination operator (which is the default for the real-valued representation). Moreover we define a maximal number of 50 generations and activate the build-in logging which is needed in order to visualized the results afterwards. ```splus # Generate the control object (set basic parameters) @@ -50,7 +50,7 @@ control = setupECRControl( n.offspring = 10L, representation = "float", survival.strategy = "plus", - save.population.at = 0:50L, + logger = setupOptPathLoggingMonitor(), stopping.conditions = list( setupMaximumIterationsTerminator(max.iter = 50L) ) @@ -64,13 +64,13 @@ control = setupEvolutionaryOperators( print(control) ``` -Now lets start the optimization process and print the result object, which contains the optimization trace, the best parameters, the best fitness value and some additional information. +Now lets start the optimization process and print the result object, which contains the optimization path, the best parameters, the best fitness value and some additional information. ```splus set.seed(123) res = doTheEvolution(obj.fun, control = control) print(res) -print(as.data.frame(res$opt.path)) +print(head(as.data.frame(res$opt.path))) print(autoplot(res, complete.trace = TRUE, log.fitness = TRUE)) ``` @@ -78,7 +78,7 @@ Further, more complicated examples are located in the *inst/examples* directory. ## Contact -Please address questions and missing features about the **ecr package** to the author Jakob Bossek . Found some nasty bugs? Please use the [issue tracker](https://github.com/jakobbossek/ecr/issues) for this. Pay attention to explain the problem as good as possible. At its best you provide an example, so I can reproduce your problem. +Please address questions and missing features about the **ecr package** to the author Jakob Bossek . Found some nasty bugs? Please use the [issue tracker](https://github.com/jakobbossek/ecr/issues) for this. Pay attention to explain the problem as good as possible. At its best you provide an example, so I can reproduce your problem quickly.