Mutation Utils

Private Methods

UTCGP._mutate_all_alleles!Function

Replace all element values with a new random_element_value.

It uses set_node_element_value! so the frozen state of the elements is respected.

source

Public Methods

UTCGP.where_to_mutateFunction
where_to_mutate(length_::Int, threshold::Float64, rng::AbstractRNG)

This functions samples from [0:1] length_ times. Each sampled number is compared against a threshold.

Example

For a threshold of 0.4 and a length_ of 10, it will, on average, return a vector with 6 0s and 4 1s.

Caveats

  • length_ >= 1

Returns a Bool Vector telling whether or not the sampled number was less or equal than the threshold.

source
UTCGP.mutate_per_allele!Function
mutate_per_allele!(node::OutputNode, run_config::runConf)

Uses the runConf.output_mutation_rate to decide whether to mutate each allele (element) of a node. An allele is mutated if a random float between 0 and 1 is inferior than the mutation value. See where_to_mutate for more info.

The mutation for each node element that ought to be mutated is done with random_element_value Hence, a uniform mutation across min-max bounds.

Returns the number of elements submitted to mutation.

source
mutate_per_allele!(node::AbstractEvolvableNode, run_config::runConf)

Uses the runConf.mutation_rate to decide whether to mutate each allele (element) of a node. An allele is mutated if a random float between 0 and 1 is inferior than the mutation value. See where_to_mutate for more info.

The mutation for each node element that ought to be mutated is done with random_element_value Hence, a uniform mutation across min-max bounds.

Returns the number of elements submitted to mutation.

source
UTCGP.mutate_one_element_from_node!Function
mutate_one_element_from_node!(node::Union{OutputNode,CGPNode})

Uniformly picks one element out of all node's elements.

That element is submitted to mutation by [random_element_value].

Returns 1

source

Standard Mutation

Forced Mutation

Numbered Mutation

Decreasing Connection Mutation