Class SimulatedSpeciesAbundancesHandler

Inheritance Relationships

Base Type

Class Documentation

class SimulatedSpeciesAbundancesHandler : public virtual necsim::SpeciesAbundancesHandler

Generates species identities from a set of species abundances.

Public Functions


Default constructor.


Default destructor.

unsigned long getRandomSpeciesID()

Gets a randomly generated species identity.

the species identity

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

Sets the abundance list.

  • abundance_list_in: map of species ids to abundances

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

Sets the abundance list.

  • abundance_list_in: vector of species abundances

void generateAbundanceTable(shared_ptr<vector<unsigned long>> abundance_list)

Generates the species abundance hash tables for efficiently storing the species identities.

  • abundance_list: vector of species abundances

void generateCumulativeAbundances(shared_ptr<vector<unsigned long>> abundance_list)

Generates the cumulative abundances, rescaled from 0-1, for randomly choosing an abundance using binary search.

  • abundance_list: vector of species abundances

unsigned long getRandomAbundanceOfIndividual()

Gets a random species abundance.

the randomly generated abundance

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

Protected Attributes

map<unsigned long, vector<unsigned long>> species_abundances
map<unsigned long, unsigned long> species_richness_per_abundance
shared_ptr<map<unsigned long, unsigned long>> cumulative_abundance_map
double total_species_number
unsigned long number_of_individuals
shared_ptr<RNGController> random
unsigned long max_species_id
unsigned long metacommunity_size
unsigned long local_community_size
long double speciation_rate