A single member of a population.
Each individual contains a genome which represents a possible solution to the task being tackled (i.e. a point in the search space).
This class is the base class of every type of individual and factorizes out common code / data members.
- Note
- AKA chromosome
-
Thread-safety guarantees are type-specific. See derived class documentation.
| hash_t ultra::individual::signature |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the cached structural signature of the individual.
- Returns
- the signature of this individual
The signature is a hash representing the logical structure of the individual. It must be maintained by the derived type whenever the individual is mutated.
Signature maps syntactically distinct (but logically equivalent) individuals to the same value.
In other words identical individuals at genotypic level have the same signature; different individuals at the genotypic level may be mapped to the same signature since real structure/computation is considered and not the simple storage.
This is a very interesting property, useful for individual comparison, information retrieval, entropy calculation...
- Note
- Concurrent calls to signature() on the same instance are safe, provided the instance is not mutated concurrently.