![]() |
Ultra 0.9.4
|
#include <individual.h>
Public Types | |
| enum | crossover_t { one_point , two_points , tree , uniform , dependency , NUM_CROSSOVERS } |
| using | const_exon_iterator = internal::basic_exon_iterator<true> |
| using | exon_iterator = internal::basic_exon_iterator<false> |
| Public Types inherited from ultra::individual | |
| using | age_t = unsigned |
Public Member Functions | |
| individual (const problem &) | |
| individual (const std::vector< gene > &) | |
| symbol::category_t | categories () const noexcept |
| bool | empty () const noexcept |
| locus::index_t | size () const noexcept |
| const gene & | operator[] (const locus &) const noexcept |
| locus | start () const noexcept |
| unsigned | mutation (const problem &, double=1.0) |
| void | apply_decision_vector (const decision_vector &) |
| crossover_t | active_crossover_type () const noexcept |
| matrix< unsigned > | analyse_importance (const std::vector< locus > &) const |
| const_exon_view | cexons () const |
| auto | begin () const noexcept |
| auto | end () const noexcept |
| bool | operator== (const individual &) const noexcept |
| bool | is_valid () const |
| Public Member Functions inherited from ultra::individual | |
| age_t | age () const noexcept |
| void | inc_age (unsigned=1) noexcept |
| bool | load (std::istream &, const symbol_set &={}) |
| bool | save (std::ostream &) const |
| hash_t | signature () const noexcept |
| std::string | format (out::print_format_t) const |
Additional Inherited Members | |
| Protected Member Functions inherited from ultra::individual | |
| void | set_if_older_age (age_t) noexcept |
| Protected Attributes inherited from ultra::individual | |
| hash_t | signature_ {} |
A single member of a genetic programming population.
Straight Line Program (SLP) is the encoding / data structure used to represent the individual.
|
explicit |
Generates the initial, random expressions that make up an individual.
| [in] | p | base problem |
The constructor is implemented so as to ensure that there is no violation of the type system's constraints.
|
explicit |
Creates a new individual containing genes from gv.
| [in] | gv | vector of genes |
This is useful for debugging purpose (i.e. setup ad-hoc individuals).
|
nodiscardnoexcept |
|
nodiscard |
Calculates the importance of genes contributing to selected loci.
| [in] | loci | loci from which dependency analysis starts |
Importance is the number of dependency paths from the selected loci to each gene. Counts saturate at the maximum value of unsigned.
| void ultra::gp::individual::apply_decision_vector | ( | const decision_vector & | v | ) |
Applies a decision vector to this individual.
| [in] | v | decision vector previously extracted from a compatible individual |
Each entry of the decision vector is written back to the corresponding argument in the genome, as identified by decision_vector::coordinate. Real-valued parameters are copied directly, while integer parameters are reconstructed by rounding the provided value to the nearest integer (std::lround).
|
nodiscardnoexcept |
|
nodiscard |
|
nodiscardnoexcept |
|
nodiscard |
| unsigned ultra::gp::individual::mutation | ( | const problem & | prb, |
| double | temperature = 1.0 ) |
A new individual is created mutating this.
| [in] | prb | the current problem |
| [in] | temperature | mutation intensity (1.0 preserves the configured probability) |
|
nodiscardnoexcept |
| [in] | rhs | second term of comparison |
| [in] | l | locus of a gene |
|
nodiscardnoexcept |
|
nodiscardnoexcept |