|
Nemo
2.2.0
|
Interface for all trait types, declares all basic trait operations. More...
#include <ttrait.h>
Inheritance diagram for TTrait:
Collaboration diagram for TTrait:Public Member Functions | |
| virtual void | init ()=0 |
| Called to allocate the trait's genotypic sequences. | |
| virtual void | init_sequence ()=0 |
| Called at the start of each replicate, sets the initial genotypes. | |
| virtual void | reset ()=0 |
| Called at the end of each simulation/replicate, deallocates sequence memory. | |
| virtual void | inherit (TTrait *mother, TTrait *father)=0 |
| Inheritance procedure, creates a new trait from mother's and father's traits. | |
| virtual void | mutate ()=0 |
| Mutation procedure, perform mutations on the genes sequence. | |
| virtual void * | set_trait (void *value)=0 |
| Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait. | |
| virtual void | set_sequence (void **seq)=0 |
| Called to set the sequence pointer to an existing trait. | |
| virtual void | set_value ()=0 |
| Tells the trait to set its phenotype from genotype, should be used instead of getValue(). | |
| virtual void * | getValue ()=0 |
| Genotype to phenotype mapper. | |
| virtual trait_t | get_type () const =0 |
| type accessor. | |
| virtual void ** | get_sequence () const =0 |
| sequence accessor. | |
| virtual void * | get_allele (int loc, int all) const =0 |
| Called to read one allele value at a particular locus. | |
| virtual void | show_up ()=0 |
| Writes some info to stdout. | |
| virtual TTrait * | clone ()=0 |
| Returns a copy of itself. | |
| virtual | ~TTrait () |
Operators | |
| virtual TTrait & | operator= (const TTrait &)=0 |
| Copies the complete state of the trait from right to left side of the operator, sequence data included. | |
| virtual bool | operator== (const TTrait &)=0 |
| Checks for parameters equivalence, not genetic equivalence. | |
| virtual bool | operator!= (const TTrait &)=0 |
Interface for all trait types, declares all basic trait operations.
This pure abstract class declares the traits intreface. The precise genetic architecture of the trait is not defined and is up to the designer of the trait. It uses void pointers to allow users to define their own structure. Existing traits use various types for their genes sequence, like char, double or bitset. It is up to the trait's user to know what kind of structure they expect. The trait objects are contained in the Individual class. Their parameters are set by their TraitPrototype.
| virtual TTrait* TTrait::clone | ( | ) | [pure virtual] |
Returns a copy of itself.
Note: call the copy constructor of the trait which should only copy the parameters values not the complete state of the trait (i.e. shallow copy). The copy of the sequence data is made through the assignement operator!
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void* TTrait::get_allele | ( | int | loc, |
| int | all | ||
| ) | const [pure virtual] |
Called to read one allele value at a particular locus.
| loc | locus position in the sequence |
| all | which allele we want to read the value from |
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void** TTrait::get_sequence | ( | ) | const [pure virtual] |
sequence accessor.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by TTDeletMutBitstrFH::FHwrite(), TTDeletMutations_bitstring::inherit_0(), TTNeutralGenes::inherit_free(), TTDeletMutations_bitstring::inherit_free(), TTNeutralGenes::inherit_low(), TTDeletMutations_bitstring::inherit_low(), TTNeutralGenesFH::write_FSTAT(), and TTNeutralGenesFH::write_varcompWC().
| virtual trait_t TTrait::get_type | ( | ) | const [pure virtual] |
type accessor.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by TTWolbachia::operator==(), TTNeutralGenes::operator==(), and TTDeletMutations_bitstring::operator==().
| virtual void* TTrait::getValue | ( | ) | [pure virtual] |
Genotype to phenotype mapper.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by Individual::getTraitValue(), and TTWolbachia::inherit().
Inheritance procedure, creates a new trait from mother's and father's traits.
| mother | the mother's trait |
| father | the father's trait |
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by Individual::create(), Individual::createTrait(), and Individual::inheritTrait().
| virtual void TTrait::init | ( | ) | [pure virtual] |
Called to allocate the trait's genotypic sequences.
Called each time a new Individual is created (Individual::init())
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void TTrait::init_sequence | ( | ) | [pure virtual] |
Called at the start of each replicate, sets the initial genotypes.
Called by Individual::create().
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void TTrait::mutate | ( | ) | [pure virtual] |
Mutation procedure, perform mutations on the genes sequence.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by Individual::create(), Individual::createTrait(), and Individual::mutateTrait().
| virtual bool TTrait::operator!= | ( | const TTrait & | ) | [pure virtual] |
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Copies the complete state of the trait from right to left side of the operator, sequence data included.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual bool TTrait::operator== | ( | const TTrait & | ) | [pure virtual] |
Checks for parameters equivalence, not genetic equivalence.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void TTrait::reset | ( | ) | [pure virtual] |
Called at the end of each simulation/replicate, deallocates sequence memory.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
| virtual void TTrait::set_sequence | ( | void ** | seq | ) | [pure virtual] |
Called to set the sequence pointer to an existing trait.
| seq | the existing sequence pointer |
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by TTNeutralGenesFH::FHread().
| virtual void* TTrait::set_trait | ( | void * | value | ) | [pure virtual] |
Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait.
| value | the value passed to the trait |
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by Individual::setTrait().
| virtual void TTrait::set_value | ( | ) | [pure virtual] |
Tells the trait to set its phenotype from genotype, should be used instead of getValue().
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
Referenced by Individual::create(), Individual::createTrait(), and Individual::setTraitValue().
| virtual void TTrait::show_up | ( | ) | [pure virtual] |
Writes some info to stdout.
Implemented in TTDeletMutations_bitstring, TTNeutralGenes, TTDispersal, TTQuanti, and TTWolbachia.
1.7.5.1 -- Nemo is hosted by