Struct site_dependent_genetic_value¶
Defined in File fitness_models.hpp
Struct Documentation¶
-
struct
fwdpp::site_dependent_genetic_value¶ Function object for fitness/trait value as a function of individual mutations in a diploid.
- Note
The updating policies must take a non-const reference to a double as the first argument and an MutationContainerType::value_type as the second. Further, they must not return anything. Any remaining arguments needed should be passed via a mechanism such as std::bind and a function object, or via a lambda expression. See fwdpp::multiplicative_diploid for an example implementation.
Public Types
-
using
result_type= double¶ The return value type.
Public Functions
-
template<typename
iterator_t, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het, typenamemake_return_value>
result_typeoperator()(iterator_t first1, iterator_t last1, iterator_t first2, iterator_t last2, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const make_return_value &rv_function, const double starting_value) const noexcept¶ Range-based call operator. Calculates genetic values over ranges of mutation keys first1/last1 and first2/last2, which are iterators derived from the ‘smutations’ of two haploid_genomes in a diploid.
- Return
Fitness (double)
- Parameters
first1: Iterator to first mutation derived from haploid_genome 1last1: Iterator to one past the last mutation derived from haploid_genome 1first2: Iterator to first mutation derived from haploid_genome 2last2: Iterator to one past the last mutation derived from haploid_genome 2mutations: The container of mutations for the simulationfpol_hom: Policy that updates genetic value for a homozygous mutation.fpol_het: Policy that updates genetic value for a heterozygous mutation.make_return_value: Policy generated the final return value. Must be equivalent to std::function<double(double)>starting_value: The initial genetic value.
-
template<typename
iterator_t, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het>
result_typeoperator()(iterator_t first1, iterator_t last1, iterator_t first2, iterator_t last2, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const double starting_value) const noexcept¶
-
template<typename
HaploidGenomeType, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het, typenamemake_return_value>
result_typeoperator()(const HaploidGenomeType &g1, const HaploidGenomeType &g2, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const make_return_value &rv_function, const double starting_value) const noexcept¶ Calculates genetic value for a diploid whose genotype across sites is given by haploid_genomes g1 and g2.
- Return
Fitness (double)
- Parameters
g1: A haploid_genomeg2: A haploid_genomemutations: The container of mutations for the simulationfpol_hom: Policy that updates genetic value for a homozygous mutation.fpol_het: Policy that updates genetic value for a heterozygous mutation.starting_value: The initial genetic value.
-
template<typename
HaploidGenomeType, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het>
result_typeoperator()(const HaploidGenomeType &g1, const HaploidGenomeType &g2, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const double starting_value) const noexcept¶
-
template<typename
DiploidType, typenameGenomeContainerType, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het, typenamemake_return_value>
result_typeoperator()(const DiploidType &dip, const GenomeContainerType &haploid_genomes, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const make_return_value &rv_function, const double starting_value) const noexcept¶ Calculates genetic value for a diploid type.
- Return
Fitness (double)
- Parameters
dip: A diploidhaploid_genomes: The container of haploid_genomes for the simulation.mutations: The container of mutations for the simulationfpol_hom: Policy that updates genetic value for a homozygous mutation.fpol_het: Policy that updates genetic value for a heterozygous mutation.starting_value: The initial genetic value.
-
template<typename
DiploidType, typenameGenomeContainerType, typenameMutationContainerType, typenameupdating_policy_hom, typenameupdating_policy_het>
result_typeoperator()(const DiploidType &dip, const GenomeContainerType &haploid_genomes, const MutationContainerType &mutations, const updating_policy_hom &fpol_hom, const updating_policy_het &fpol_het, const double starting_value) const noexcept¶