- 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
Functions Bundles, Libraries and MetaLibraries
Bundles
Library
UTCGP.AbstractLibrary — Type
Parent of all concrete Libraries
UTCGP.Library — Type
A Library Holds ALL functions that return a 'type' for UTCGP
Callable functions come in bundles of FunctionWrappers.
So the Library first store the bundles and then unpacks them to create the internal library.
UTCGP.Library — Method
Library(bundles::Vector{FunctionBundle})Creates a library adding all function bundles.
The vector of FunctionBundles is deepcopyed so that changes to that vector don't affect the Library.
The internal library of FunctionWrappers is empty.
Base.size — Function
size(library::AbstractLibrary)Returns the size of the internal library (that holds FunctionWrappers).
size(ml::AbstractMetaLibrary)Returns the number of libraries in the MetaLibrary.
size(shared_inputs::AbstractGenomeInputs)Returns the number of inputs in the internal vector.
size(genome::AbstractGenome)Returns the size of the internal chromosome (a vector of nodes)
size(genome::AbstractMetaGenome)Returns the size of the internal chromosome (a vector of nodes)
Base.size(program::Program)Number of operations.
Base.size(pop_progs::PopulationPrograms)Number of IndividualPrograms inside the population.
Usually the number of individuals
Base.length — Function
length(library::AbstractLibrary)Returns the size of the internal library (that holds FunctionWrappers).
length(ml::AbstractMetaLibrary)Returns the number of libraries in the MetaLibrary.
length(shared_inputs::AbstractGenomeInputs)Returns the number of inputs in the internal vector.
length(genome::AbstractGenome)Returns the size of the internal chromosome (a vector of nodes)
length(genome::AbstractMetaGenome)Returns the size of the internal chromosome (a vector of nodes)
Base.length(program::Program)Number of operations.
Base.length(pop_progs::PopulationPrograms)Number of IndividualPrograms inside the population.
Usually the number of individuals
Base.getindex — Function
Indexes the internal library at a given index.
Index the library with the name of a function
Returns the library at a given index.
Gets multiple inputs at several indices.
Indexes the internal vector of nodes at a given index.
Indexes the internal vector of nodes at multiple indices.
Indexes the internal vector of nodes at a given index.
Indexes the internal vector of nodes at multiple indices.
Base.getindex(program::Program, i::Int)Returns the ith operation in the program.
Base.getindex(pop_progs::PopulationPrograms, i::Int)Index an IndividualPrograms
Base.getindex(pop_progs::PopulationPrograms, idx::Vector{Int})Index an IndividualPrograms
Base.iterate — Function
Iterates over the internal node elements.
It iterates over the node_meterial vector.
Iterates the internal library.
Iterates over all libraries in the MetaLibrary
Iterates over the inputs.
Iterates the internal chromosome (a vector of nodes) .
Iterates the internal chromosome (a vector of nodes) .
Base.iterate(program::Program, state = 1)Iterate over Operations in the program.
Base.iterate(pop_progs::PopulationPrograms, state = 1)Iterate over IndividualPrograms.
UTCGP.add_bundle_to_library! — Function
add_bundle_to_library!(library::AbstractLibrary, bundle::FunctionBundle)::IntAdds a bundle to the bundles of the Library.
Returns the length of the internal bundles after addition (nb of bundles in the Library).
UTCGP.unpack_bundles_in_library! — Function
From all the bundles in the Library, it unpacks them and adds ALL functions to the internal list of functions.
It's a way of having all functions (comming from multiple bundles) in the same place.
This operation is meant to be run once, after all bundles have been added to the Library.
Caveats:
- This functions will replace the previous (if any) content of the internal list of fns
of the Library. A warning is given if the list of functions was not empty.
- A warning is also given if the bundles, after unpacking, resulted in an empty list of functions.
Returns the number of functions in Library (after unpacking).
UTCGP.list_functions_names — Method
list_functions_names(library::Library;symbol::Bool = false)Returns the names of all the functions in the library.
Useful for reproducibility.
The vector can be asked as a vector of strings or a vector of symbols.
MetaLibrary
UTCGP.AbstractMetaLibrary — Type
Parent of all concrete MetaLibraries
UTCGP.MetaLibrary — Type
A MetaLibrary holds multiple Libraries. A Library holds functions.
UTCGP.MetaLibrary — Method
MetaLibrary(libs::Vector{<:AbstractLibrary})From a vector of libraries, they will be unpacked and added to the MetaLibrary.
Caveats:
- The vector of libraries can't be empty.
- The libraries will be unpacked one by one
- The libraries can't be empty
UTCGP.list_functions_names — Method
list_functions_names(meta_library::MetaLibrary)Returns a vector of vectors (one per library). Each vector is a list of functions inside the library.
Casters
UTCGP.listinteger_caster — Function
listinteger_caster(l :: Vector{<:Number})Cast a vector of generic Number type to concrete Int64 type.
Numbers are floored.
UTCGP.listfloat_caster — Function
listfloat_caster(l :: Vector{<:Number})Cast a vector of generic Number type to concrete Float64 type.
UTCGP.liststring_caster — Function
liststring_caster(l :: Vector{<:Any})Cast a vector of generic Number type to concrete Float64 type.