Program Listing for File Metacommunity.h

Return to documentation for file (necsim/Metacommunity.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 <string>
#include <sqlite3.h>
#include <set>
#include <memory>
#include "Community.h"
#include "Tree.h"
#include "RNGController.h"
#include "SpecSimParameters.h"
#include "SpeciesAbundancesHandler.h"

using namespace std;
namespace necsim
    class Metacommunity : public virtual Community
        // Simulation seed and job_type (read from the output database or set to 1)
        unsigned long seed;
        unsigned long job_type;
        bool parameters_checked;
        unique_ptr<SpeciesAbundancesHandler> species_abundances_handler;
        shared_ptr<RNGController> random;
        unique_ptr<Tree> metacommunity_tree;


        ~Metacommunity() override = default;

        void setCommunityParameters(shared_ptr<MetacommunityParameters> metacommunity_parameters);

        void checkSimulationParameters();

        void addSpecies(unsigned long &species_count, TreeNode* tree_node, set<unsigned long> &species_list) override;

        void createMetacommunityNSENeutralModel();

        void applyNoOutput(shared_ptr<SpecSimParameters> sp, shared_ptr<vector<TreeNode>> tree_data) override;

        void approximateSAD();

        void readSAD();

        void printMetacommunityParameters();