Evolutionary Diversification in Anolis Lizards
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
edal::Patch Class Reference

Public Types

using URBG = wtl::sfmt19937_64
 

Public Member Functions

 Patch (unsigned int seed)
 Construct an empty patch.
 
 Patch (Patch &&) noexcept
 move constructor;
 
 ~Patch ()
 destructor in cpp for incomplete type
 
void assign (size_t n, const Individual &founder)
 Fill this patch with the same number of females and males. More...
 
void emplace_back (Individual &&ind)
 Add an individual to this patch. More...
 
size_t size () const
 
bool empty () const
 
std::map< Individual, size_t > summarize () const
 Count genotypes.
 
std::vector< Individualmate_and_reproduce () const
 All females mate with someone according to mating probability. More...
 
std::vector< std::pair< unsigned, unsigned int > > make_destinations (size_t n, size_t row, size_t col, size_t num_rows, size_t num_cols) const
 Change row/col with probability \(m\) = Individual::MIGRATION_RATE_. More...
 
void viability_selection ()
 Some individuals die depending on Individual::survival_probability()
 

Private Member Functions

std::vector< double > effective_num_competitors () const
 Calculate \(N_e(I)\) from \(C(I,J)\). More...
 
void change_sex_half (size_t n)
 Change sex of second half members.
 

Private Attributes

std::vector< Individualmembers_
 Individuals.
 
std::unique_ptr< URBG > engine_
 

Member Function Documentation

◆ assign()

void edal::Patch::assign ( size_t  n,
const Individual founder 
)

Fill this patch with the same number of females and males.

Parameters
nThe number of inital individuals in this patch
founderThe individual to be copied

◆ emplace_back()

void edal::Patch::emplace_back ( Individual &&  ind)
inline

Add an individual to this patch.

Parameters
indNew individual to add

◆ empty()

bool edal::Patch::empty ( ) const
inline
Returns
Whether this patch is empty or not

◆ make_destinations()

std::vector< std::pair< unsigned int, unsigned int > > edal::Patch::make_destinations ( size_t  n,
size_t  row,
size_t  col,
size_t  num_rows,
size_t  num_cols 
) const

Change row/col with probability \(m\) = Individual::MIGRATION_RATE_.

With probability \( m > 0 \), each offspring becomes a "migrant." Each migrant goes to one of the 8 neighboring patches. For patches at the boundary, the probability \( m \) is reduced according to the number of neighbors they have.

◆ size()

size_t edal::Patch::size ( ) const
inline
Returns
The number of individuals in this patch

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