## Generated by Codox

# Propeller 0.3.2

# propeller.gp

Main genetic programming loop.

### gp

`(gp {:keys [population-size max-generations error-function instructions max-initial-plushy-size solution-error-threshold mapper], :or {solution-error-threshold 0.0, mapper pmap}, :as argmap})`

Main GP loop.

On each iteration, it creates a population of random plushies using a mapper function and genome/make-random-plushy function, then it sorts the population by the total error using the error-function and sort-by function. It then takes the best individual from the sorted population, and if the parent selection is set to epsilon-lexicase, it adds the epsilons to the argmap.

The function then checks if the custom-report argument is set, if so it calls that function passing the evaluated population, current generation and argmap. If not, it calls the report function passing the evaluated population, current generation and argmap.

Then, it checks if the total error of the best individual is less than or equal to the solution-error-threshold or if the current generation is greater than or equal to the max-generations specified. If either is true, the function exits with the best individual or nil. If not, it creates new individuals for the next generation using the variation/new-individual function and the repeatedly function, and then continues to the next iteration of the loop.

### report

`(report pop generation argmap)`

Reports information for each generation.