clojush.pushgp.genetic-operators

age-combining-function

(age-combining-function argmap)

Returns the actual age combining function specified by the :age-combining-function in the argmap. The function will take three arguments: the two parents, and the genome of the child.

alternation

(alternation parent1 parent2 {:keys [alternation-rate alignment-deviation max-points maintain-ancestors], :as argmap})

Uniformly alternates between the two parents using a similar method to that used in ULTRA.

autoconstruction

(autoconstruction parent1 parent2 {:keys [maintain-ancestors atom-generators max-genome-size-in-initial-program error-function autoconstructive-improve-or-diversify autoconstructive-fotd autoconstructive-clone-probability autoconstructive-entropy], :as argmap})

Returns a genome for a child produced either by autoconstruction (executing parent1 with both parents on top of the genome stack and also available via input instructions) or by cloning. In either case if the child is not diversifying then a random genome is returned instead IF that is itself diversifying; if it isn’t then an empty genome is returned. The construct/clone ration is hardcoded here, but might be set globally or eliminated in the future.

compute-grain-size

(compute-grain-size genome {:keys [random-screen], :as argmap})(compute-grain-size genome parent1 {:keys [random-screen], :as argmap})(compute-grain-size genome parent1 parent2 {:keys [random-screen], :as argmap})

Returns the grain size for the individual with the provided genome, as produced by the provided parents, according to the :random-screen settings in argmap. Grain sizes should range from 0 to 1. Individuals with smaller grain sizes will survive screens of a wider range of sizes.

diffmeans-diversifying?

(diffmeans-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

diversifying?

(diversifying? g argmap)

Returns true iff genome g passes the diversification test.

doesnt-clone-diversifying?

(doesnt-clone-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

expressed-difference

(expressed-difference g1 g2 argmap)

Returns the levenshtein distance between the open-close sequences for the programs encoded by genomes g1 and g2.

expressed-program-sequence-from-genome

(expressed-program-sequence-from-genome g argmap)

Returns an open-close sequenc for the program produced by expressing genome g.

fotd-autoconstruction

(fotd-autoconstruction parent1 parent2 {:keys [maintain-ancestors atom-generators max-genome-size-in-initial-program error-function], :as argmap})

A historical ‘flavor of the day’ version of autoconstruction, used by specifying :autoconstructive-fotd true in the arguments to pushgp. Expect changes. Other autoconstruction-related parameters may or may not have any effect when using the fotd.

gaussian-noise-factor

(gaussian-noise-factor)

Returns gaussian noise of mean 0, std dev 1.

gecco2016-diversifying?

(gecco2016-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

genesis

(genesis ind {:keys [maintain-ancestors max-genome-size-in-initial-program atom-generators], :as argmap})

Ignores the provided parent and returns a new, random individual, with age 0.

minimal-reproductive-difference-diversifying?

(minimal-reproductive-difference-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

minimum-genetic-difference-diversifying?

(minimum-genetic-difference-diversifying? g {:keys [parent1-genome parent2-genome]})

Returns true iff genome g passes the diversification test.

not-a-clone-diversifying?

(not-a-clone-diversifying? g {:keys [parent1-genome parent2-genome], :as argmap})

Returns true iff genome g passes the diversification test.

number

(number number-or-numbers)

If given a number, returns it. If given a collection, returns a member of the collection. Intended for allowing arguments to genetic operators, such as mutation rates, to take collections in addition to single values

perturb-with-gaussian-noise

(perturb-with-gaussian-noise sd n)

Returns n perturbed with std dev sd.

process-genome-for-autoconstruction

(process-genome-for-autoconstruction genome)

Replaces input instructions with noops and autoconstructive__rand with _rand.

produce-child-genome-by-autoconstruction

(produce-child-genome-by-autoconstruction parent1-genome parent2-genome argmap)(produce-child-genome-by-autoconstruction genome-to-run parent1-genome parent2-genome argmap)

Runs the program expressed by parent1-genome with both parent genomes on the genome stack and also available via input instructions, and returns the resulting top genome.

remove-uniform-padding

(remove-uniform-padding genome)

Removes instances of ’uniform-padding from genome.

reproduction

(reproduction ind argmap)

Returns parent

safe-t-test

(safe-t-test xvec yvec)

si-and-mate-use-diversifying?

(si-and-mate-use-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

size-and-instruction-diversifying?

(size-and-instruction-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

tag-gaussian-tweak

(tag-gaussian-tweak instr-map uniform-mutation-tag-gaussian-standard-deviation)

Tweaks the tag with Gaussian noise.

three-gens-diff-diffs-diversifying?

(three-gens-diff-diffs-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

three-gens-same-inputs-diff-diffs-diversifying?

(three-gens-same-inputs-diff-diffs-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

three-gens-size-and-instruction-diversifying?

(three-gens-size-and-instruction-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

three-gens-some-diff-diffs-diversifying?

(three-gens-some-diff-diffs-diversifying? g argmap)

Returns true iff genome g passes the diversification test.

two-point-crossover

(two-point-crossover parent1 parent2 {:keys [maintain-ancestors], :as argmap})

Crossover of two parents. Each parent will have two points randomly selected, and the code between the two points in the first parent will be replaced by the code between the two points in the second parent.

uniform-addition

(uniform-addition ind {:keys [uniform-addition-rate maintain-ancestors atom-generators], :as argmap})

Returns the individual with each element of its genome possibly preceded or followed by a new gene, with probability given by uniform-addition-rate.

uniform-addition-and-deletion

(uniform-addition-and-deletion ind {:keys [uniform-addition-and-deletion-rate maintain-ancestors atom-generators], :as argmap})

Returns the individual after two passes of mutation. In the first pass, each element of its genome may possibly be preceded or followed by a new gene. In the second pass, each element of the genome may possibly be deleted. Probabilities are given by uniform-addition-and-deletion-rate.

uniform-boolean-mutation

(uniform-boolean-mutation ind {:keys [uniform-mutation-constant-tweak-rate maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each boolean in the genome, there is uniform-mutation-constant-tweak-rate probability of being mutated.

uniform-close-mutation

(uniform-close-mutation ind {:keys [uniform-close-mutation-rate close-increment-rate epigenetic-markers maintain-ancestors], :as argmap})

Uniformly mutates the :close’s in the individual’s instruction maps. Each :close will have a uniform-close-mutation-rate probability of being changed, and those that are changed have a close-increment-rate chance of being incremented, and are otherwise decremented.

uniform-combination-and-deletion

(uniform-combination-and-deletion parent1 parent2 {:keys [uniform-combination-and-deletion-rate maintain-ancestors atom-generators], :as argmap})

Returns parent1 after two passes of modification. In the first pass, each element of its genome may possibly be preceded or followed by the corresponding element from parent 2’s genome (which will wrap if it is too short). In the second pass, each element of the genome may possibly be deleted. Probabilities are given by uniform-combination-and-deletion-rate.

uniform-crossover

(uniform-crossover parent1 parent2 {:keys [maintain-ancestors], :as argmap})

Uniform crossover of two parents. At each index in the child, an instruction will be taken from one of the two parents at random.

uniform-deletion

(uniform-deletion ind {:keys [uniform-deletion-rate maintain-ancestors], :as argmap})

Returns the individual with each element of its genome possibly deleted, with probability given by uniform-deletion-rate.

uniform-float-mutation

(uniform-float-mutation ind {:keys [uniform-mutation-constant-tweak-rate uniform-mutation-float-gaussian-standard-deviation maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each float in the genome, there is uniform-mutation-constant-tweak-rate probability of being mutated.

uniform-instruction-mutation

(uniform-instruction-mutation ind {:keys [uniform-mutation-rate maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each token in the genome, there is uniform-mutation-rate probability of being mutated. If a token is to be mutated it will be replaced with a random instruction.

uniform-integer-mutation

(uniform-integer-mutation ind {:keys [uniform-mutation-constant-tweak-rate uniform-mutation-int-gaussian-standard-deviation maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each integer in the genome, there is uniform-mutation-constant-tweak-rate probability of being mutated.

uniform-mutation

(uniform-mutation ind {:keys [uniform-mutation-rate uniform-mutation-constant-tweak-rate uniform-mutation-float-gaussian-standard-deviation uniform-mutation-int-gaussian-standard-deviation uniform-mutation-tag-gaussian-standard-deviation uniform-mutation-string-char-change-rate maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each token in the genome, there is uniform-mutation-rate probability of being mutated. If a token is to be mutated, it has a uniform-mutation-constant-tweak-rate probability of being mutated using a constant mutator (which varies depending on the type of the token), and otherwise is replaced with a random instruction.

uniform-silence-mutation

(uniform-silence-mutation ind {:keys [uniform-silence-mutation-rate epigenetic-markers maintain-ancestors], :as argmap})

Uniformly mutates the :silent’s in the individual’s instruction maps. Each :silent will have a uniform-silence-mutation-rate probability of being switched.

uniform-string-mutation

(uniform-string-mutation ind {:keys [uniform-mutation-rate uniform-mutation-string-char-change-rate maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each string literal in the genome, there is uniform-mutation-rate probability of being mutated.

uniform-tag-mutation

(uniform-tag-mutation ind {:keys [uniform-mutation-rate uniform-mutation-tag-gaussian-standard-deviation maintain-ancestors atom-generators], :as argmap})

Uniformly mutates individual. For each tag instruction in the genome, there is uniform-mutation-rate probability of being mutated.

use-mate-differently-diversifying?

(use-mate-differently-diversifying? g argmap)

Returns true iff genome g passes the diversification test.