(evolve allele-set
genome-length
population-size
generations
fitness-function
binary-operators
unary-operators)(evolve allele-set
genome-length
population-size
generations
fitness-function
binary-operators
unary-operators
options)Create and evolve a population under the specified conditions until a termination criteria is reached
allele-set is a collection of legal genome values
genome-length is the enforced size of each genetic sequence
population-size is the enforced number of individuals that will be created
generations is the number of iterations the algorithm will cycle through
fitness-function is a partial function accepting generated sequences to evaluate solution qualities
binary-operators is a collection of partial functions accepting and returning 1 or more individuals
unary-operators is a collection of partial functions accepting and returning exactly 1 individual
options an optional map of pre-specified keywords to values that further tune the behavior of nature.
Current examples follow:
:carry-over an integer representing the top n individuals to be carried over between each generation. Default is 1
:solutions an integer representing the top n individuals to return after evolution completes. Default is 1
:monitors a sequence of functions, assumed to be side-effectful, to be executed against population and current-genration for run-time stats. Default is nil
Create and evolve a population under the specified conditions until a termination criteria is reached `allele-set` is a collection of legal genome values `genome-length` is the enforced size of each genetic sequence `population-size` is the enforced number of individuals that will be created `generations` is the number of iterations the algorithm will cycle through `fitness-function` is a partial function accepting generated sequences to evaluate solution qualities `binary-operators` is a collection of partial functions accepting and returning 1 or more individuals `unary-operators` is a collection of partial functions accepting and returning exactly 1 individual `options` an optional map of pre-specified keywords to values that further tune the behavior of nature. Current examples follow: `:carry-over` an integer representing the top n individuals to be carried over between each generation. Default is 1 `:solutions` an integer representing the top n individuals to return after evolution completes. Default is 1 `:monitors` a sequence of functions, assumed to be side-effectful, to be executed against `population` and `current-genration` for run-time stats. Default is nil
(evolve-cooperatively species-a species-b generations collaboration-fitness-fn)(evolve-cooperatively species-a
species-b
generations
collaboration-fitness-fn
options)Evolve two populations whose contextual fitness comes from collaboration.
Each species configuration contains :species-id, :population-size,
:genome-generator, :binary-operators, and :unary-operators; optional
:carry-over and :insert-new values default to 1 and 0. Binary operators
accept two genomes and return one or more child genomes. Unary operators
accept and return one genome. collaboration-fitness-fn accepts one genome
from each species (in argument order) and returns a finite numeric score.
Options are :collaboration-mode (:balanced, the default, :cartesian, or :panel),
:opponents (K for balanced scheduling, default 1), :final-ratio (default
1.0), :final-evaluation-fn, and :monitors. Final evaluators accept the two
genomes and may return any value. Each monitor accepts the complete state map.
All collaboration modes accept :credit-policy (default :mean): :maximum, :top-two-mean, :weighted (with :credit-weights), or a custom context-to-finite-scalar callback. See nature.credit and README for the contract.
Panel mode accepts a non-empty :panel-selection-fns sequence, defaulting
when omitted to one random member. Generation zero uses random bootstrap
panels; selectors use each completed scored population and bounded historical
champions to build the next panels.
See nature.panel-selectors for selector functions and README for context keys.
Evolve two populations whose contextual fitness comes from collaboration. Each species configuration contains `:species-id`, `:population-size`, `:genome-generator`, `:binary-operators`, and `:unary-operators`; optional `:carry-over` and `:insert-new` values default to 1 and 0. Binary operators accept two genomes and return one or more child genomes. Unary operators accept and return one genome. `collaboration-fitness-fn` accepts one genome from each species (in argument order) and returns a finite numeric score. Options are `:collaboration-mode` (`:balanced`, the default, `:cartesian`, or `:panel`), `:opponents` (K for balanced scheduling, default 1), `:final-ratio` (default 1.0), `:final-evaluation-fn`, and `:monitors`. Final evaluators accept the two genomes and may return any value. Each monitor accepts the complete state map. All collaboration modes accept :credit-policy (default :mean): :maximum, :top-two-mean, :weighted (with :credit-weights), or a custom context-to-finite-scalar callback. See nature.credit and README for the contract. Panel mode accepts a non-empty `:panel-selection-fns` sequence, defaulting when omitted to one random member. Generation zero uses random bootstrap panels; selectors use each completed scored population and bounded historical champions to build the next panels. See nature.panel-selectors for selector functions and README for context keys.
(evolve-with-sequence-generator generator-function
population-size
generations
fitness-function
binary-operators
unary-operators)(evolve-with-sequence-generator generator-function
population-size
generations
fitness-function
binary-operators
unary-operators
options)Same with evolve method, but takes a sequence generator function instead of an allele set and genome length.
This method uses the sequence generator function to generate sequences for the initial population.
:initial-population-retries optionally rebuilds the initial population when every fitness score is zero. Default is 0.
Same with evolve method, but takes a sequence generator function instead of an allele set and genome length. This method uses the sequence generator function to generate sequences for the initial population. `:initial-population-retries` optionally rebuilds the initial population when every fitness score is zero. Default is 0.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |