Struct site_dependent_genetic_value

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, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het, typename make_return_value>
result_type operator()(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 1

  • last1: Iterator to one past the last mutation derived from haploid_genome 1

  • first2: Iterator to first mutation derived from haploid_genome 2

  • last2: Iterator to one past the last mutation derived from haploid_genome 2

  • mutations: The container of mutations for the simulation

  • fpol_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, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het>
result_type operator()(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, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het, typename make_return_value>
result_type operator()(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_genome

  • g2: A haploid_genome

  • mutations: The container of mutations for the simulation

  • fpol_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, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het>
result_type operator()(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, typename GenomeContainerType, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het, typename make_return_value>
result_type operator()(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 diploid

  • haploid_genomes: The container of haploid_genomes for the simulation.

  • mutations: The container of mutations for the simulation

  • fpol_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, typename GenomeContainerType, typename MutationContainerType, typename updating_policy_hom, typename updating_policy_het>
result_type operator()(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