- Entry Point
- High Level
- Traits
- Helper
- MAGE.jl
- Functions Bundles, Libraries and MetaLibraries
- Element Operations
- Image Lib
- Integer Operations
- List Generic Operations
- LIST Integer Operations
- List Generic Operations
- List String Operations
- Integer Operations
- String Operations
- Mutation Utils
- Standard Mutation
- Forced Mutation
- Numbered Mutation
- Decreasing Connection Mutation
- Symbolic Regression
Mutation Utils
Private Methods
UTCGP._sample_one_node_element_idx — Function
Returns the argmax from nb_of_elements sampled numbers. Useful for selecting one element out of a list of possible elements.
UTCGP._bool_vector_to_idx_vector — Function
_bool_vector_to_idx_vector(bv::Vector{Bool})::Vector{Int}Index where 1, not present otherwise.
Useful to then index a vector by positions.
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.
Public Methods
UTCGP.where_to_mutate — Function
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.
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.
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.
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