Template Function fwdpp::ts::generate_offspring

Function Documentation

template<typename genetic_param_holder, typename mutation_handling_policy, typename poptype>
std::pair<mut_rec_intermediates, mut_rec_intermediates> fwdpp::ts::generate_offspring(const gsl_rng *r, const std::pair<std::size_t, std::size_t> parents, const mutation_handling_policy &mutation_policy, poptype &pop, genetic_param_holder &genetics, typename poptype::diploid_type &offspring)

Generate offspring haploid_genomes and return breakpoints plus mutation keys.

The final three parameters will be modified.

Parameters

The operations are dispatched out to functions based on the population type. These functions make calls to

fwdpp::mutate_recombine.
Return

A pair of mut_rec_intermediates, corresponding to what is passed on from each parent.

The parameter mutation_policy governs what types of mutations are entered into the haploid_genomes of offspring. If the policy is fwdpp::ts::all_mutations, then neutral and selected variants are placed in an offspring’s haploid_genomes. If the policy is fwdpp::ts::selected_variants_only, then only selected mutations are placed into the haploid_genomes. Regardless of the policy, ALL mutations are contained in the return value, with the idea that the caller will record them into a fwdpp::ts::table_collection.

Note

The function type genetic_param_holder::generate_mutations must return std::vector<fwdpp::uint_t>, with the values reflecting the locations of new mutations on pop.mutations. Further, this function must already bind any relevant mutation rates (as this generate_offspring does not accept them as arguments).

Version

0.7.4 Added to fwdpp::ts.