Class AnalyticalSpeciesAbundancesHandler

Inheritance Relationships

Base Type

Class Documentation

class AnalyticalSpeciesAbundancesHandler : public virtual necsim::SpeciesAbundancesHandler

Public Functions


Default constructor.


Default destructor.

void setup(shared_ptr<RNGController> random, const unsigned long &metacommunity_size, const long double &speciation_rate, const unsigned long &local_community_size)

Creates the SpeciesAbundancesHandler object.

  • random: the random number generator
  • metacommunity_size: the number of individuals in the metacommunity
  • speciation_rate: the speciation rate of the metacommunity
  • local_community_size: the number of individuals in the local community

void generateSpeciesAbundances()

Generates the species abundances using the analytical approximation.

unsigned long getRandomSpeciesID()

Gets a randomly generated species identity.

the species identity

unsigned long pickPreviousIndividual(const unsigned long &individual_id)

Picks out a random individual from previously-seen individuals.

species id of the individual
  • individual_id: the individual id number to pick

void addNewSpecies()

Picks out a new individual/species id with a random species abundance.

the species id of the new individual

unsigned long getRandomAbundanceOfSpecies()

Gets a random species abundance by sampling from the logarithmic distribution.

this produces the abundance of any given species, not the abundance of any given individual
the randomly generated abundance of a species

void setAbundanceList(const shared_ptr<map<unsigned long, unsigned long>> &abundance_list_in)

Sets the abundance list.

  • abundance_list_in: list of abundances for each species

void setAbundanceList(shared_ptr<vector<unsigned long>> abundance_list_in)

Sets the abundance list.

  • abundance_list_in: list of abundances for each species

Protected Attributes

unsigned long seen_no_individuals
map<unsigned long, unsigned long> ind_to_species
shared_ptr<RNGController> random
unsigned long max_species_id
unsigned long metacommunity_size
unsigned long local_community_size
long double speciation_rate