tek2
tek::Population Class Reference

Population class. More...

#include <population.hpp>

Public Types

using param_type = PopulationParams
 Alias.
 

Public Member Functions

 Population (size_t size, size_t num_founders=1)
 constructor
 
 Population (const Population &other)=default
 default copy constructor
 
 ~Population ()
 destructor
 
bool evolve (size_t max_generations, size_t record_interval, Recording flags=Recording::activity|Recording::fitness, size_t t_hyperactivate=0u)
 return false if TE is extinct
 
std::ostream & write_summary (std::ostream &) const
 write summary in JSON format
 
std::ostream & write_fasta_individual (std::ostream &, size_t i) const
 count identicals and write FASTA for i-th individual
 
std::ostream & write_fasta (std::ostream &, size_t num_individuals=-1u) const
 call write_fasta_individual() repeatedly
 

Static Public Member Functions

static void param (const param_type &p)
 Set PARAM_.
 
static const param_typeparam ()
 Get PARAM_.
 
static void seed (std::mt19937_64::result_type value)
 Set SEEDER_ seed.
 

Static Public Attributes

static constexpr double THETA = 0.01
 \(\theta = 4N\mu\), population mutation rate
 
static constexpr double RHO = 20000
 \(\rho = 4Nc\), population recombination rate
 

Private Member Functions

std::vector< double > step (double previous_max_fitness=1.0)
 proceed one generation and return fitness record
 
void eval_species_distance ()
 find farthest element, count species, and cause speciation if qualified
 
bool is_extinct () const
 return true if no TE exists in gametes_
 
void write_activity (std::ostream &, size_t time, bool header) const
 summarize and write activity
 

Private Attributes

std::vector< Haploidgametes_
 vector of chromosomes, not individuals
 

Static Private Attributes

static param_type PARAM_
 Parameters shared among instances.
 
static std::mt19937_64 SEEDER_
 seed generator for Haploid::URBG
 

Friends

std::ostream & operator<< (std::ostream &ost, const Population &pop)
 shortcut << Population::gametes_
 

Detailed Description

Population class.


The documentation for this class was generated from the following files: