Program Listing for File AnalyticalSpeciesAbundancesHandler.h

Return to documentation for file (necsim/AnalyticalSpeciesAbundancesHandler.h)

// This file is part of necsim project which is released under MIT license.
// See file **LICENSE.txt** or visit for full license details.


#include "SpeciesAbundancesHandler.h"
#include "neutral_analytical.h"
#include "RNGController.h"

namespace na = neutral_analytical;
using namespace std;
namespace necsim
    class AnalyticalSpeciesAbundancesHandler : public virtual SpeciesAbundancesHandler
        unsigned long seen_no_individuals;
        // Store all previous species ids in a map of cumulative numbers of individuals for searching for ids
        map<unsigned long, unsigned long> ind_to_species;


        ~AnalyticalSpeciesAbundancesHandler() override = default;

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

        void generateSpeciesAbundances();

        unsigned long getRandomSpeciesID() override;

        unsigned long pickPreviousIndividual(const unsigned long &individual_id);

        void addNewSpecies();

        unsigned long getRandomAbundanceOfSpecies();