![]() |
Ultra 0.9.4
|
#include <individual.h>
Public Member Functions | |
| individual (const ultra::problem &p) | |
| unsigned | mutation (const problem &, double=1.0) |
| template<class F> requires std::invocable<F &, T &> && std::same_as<std::invoke_result_t<F &, T &>, void> | |
| void | apply_each (std::size_t, std::size_t, F &&) |
| template<class F> requires std::invocable<F &, T &> && std::same_as<std::invoke_result_t<F &, T &>, void> | |
| void | apply_each (F &&) |
| vector_individual & | operator= (const std::vector< T > &) |
| Public Member Functions inherited from ultra::vector_individual< D_INT > | |
| void | apply_each (std::size_t first, std::size_t last, F &&f) |
| void | apply_each (F &&f) |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| const value_type & | operator[] (std::size_t) const |
| vector_individual & | operator= (const std::vector< D_INT > &) |
| bool | empty () const noexcept |
| std::size_t | size () const noexcept |
| std::size_t | parameters () const noexcept |
| operator const std::vector< D_INT > & () 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 |
Friends | |
| individual | crossover (const problem &, const individual &, const individual &) |
Additional Inherited Members | |
| Public Types inherited from ultra::vector_individual< D_INT > | |
| using | genome_t |
| using | const_iterator |
| using | iterator |
| using | value_type |
| Public Types inherited from ultra::individual | |
| using | age_t = unsigned |
| Protected Member Functions inherited from ultra::vector_individual< D_INT > | |
| hash_t | hash () const override |
| Protected Member Functions inherited from ultra::individual | |
| void | set_if_older_age (age_t) noexcept |
| Protected Attributes inherited from ultra::vector_individual< D_INT > | |
| genome_t | genome_ |
| Protected Attributes inherited from ultra::individual | |
| hash_t | signature_ {} |
| Related Symbols inherited from ultra::vector_individual< D_INT > | |
| bool | operator== (const vector_individual< D_INT > &lhs, const vector_individual< D_INT > &rhs) noexcept |
| std::size_t | active_slots (const vector_individual< D_INT > &ind) noexcept |
An GA-individual optimized for combinatorial optimization.
| void ultra::vector_individual< T >::apply_each | ( | F && | f | ) |
Applies an operation to every gene and updates the signature.
| f | mutating callable returning void |
| void ultra::vector_individual< T >::apply_each | ( | std::size_t | first, |
| std::size_t | last, | ||
| F && | f ) |
Applies an operation to a range of genes and updates the signature.
| first | first index (inclusive) |
| last | one past the last index (exclusive) |
| f | mutating callable returning void |
| unsigned ultra::ga::individual::mutation | ( | const problem & | prb, |
| double | temperature = 1.0 ) |
Mutates the current individual.
| [in] | prb | the current problem |
| [in] | temperature | mutation intensity (1.0 preserves the configured probability) |
| vector_individual< T > & vector_individual::operator= | ( | const std::vector< T > & | v | ) |
Replaces the genome and updates its signature.
| [in] | v | replacement genes |