Struct additive_diploid

Struct Documentation

struct fwdpp::additive_diploid

Additive fitness or trait value across sites This function object calculate the genetic value of a diploid according to an additive model with dominance effects per mutation.

The genetic value is calculated via fwdpp::site_dependent_genetic_value.

The genetic value may be treated as a fitness or as a trait value based on arguments passed to the constructor.

Public Types

using result_type = site_dependent_genetic_value::result_type

Public Functions

std::function<double(double)> assign_f(trait)

Specifies final mapping of genetic value.

std::function<double(double)> assign_f(fitness)
additive_diploid(fitness f)

Construct an object to calculate fitness values

Parameters
  • f: fwdpp::fitness, where the double represents the scaling of the “aa” genotype

template<typename make_return_value_fxn>
additive_diploid(fitness f, make_return_value_fxn &&make_rv)
additive_diploid(trait t)

Construct an object to calculate trait/phenotype values

Parameters
  • t: fwdpp::trait, where the double represents the scaling of the “aa” genotype

template<typename make_return_value_fxn>
additive_diploid(trait t, make_return_value_fxn &&make_rv)
template<typename iterator_t, typename MutationContainerType>
result_type operator()(iterator_t first1, iterator_t last1, iterator_t first2, iterator_t last2, const MutationContainerType &mutations) const noexcept

Range-based overload.

template<typename HaploidGenomeType, typename MutationContainerType>
result_type operator()(const HaploidGenomeType &g1, const HaploidGenomeType &g2, const MutationContainerType &mutations) const noexcept

Return

Additive genetic value across sites.

Note

g1 and g2 must be part of the haploid_genome_base hierarchy

Parameters
  • g1: A haploid_genome

  • g2: A haploid_genome

  • mutations: A container of mutations

template<typename DiploidType, typename GenomeContainerType, typename MutationContainerType>
result_type operator()(const DiploidType &dip, const GenomeContainerType &haploid_genomes, const MutationContainerType &mutations) const noexcept

Overload for diploids. This is what a programmer’s functions will call.

Public Members

const double scaling
const bool gvalue_is_trait
const bool gvalue_is_fitness
const std::function<double(double)> make_return_value