Program Listing for File SpeciesList.h

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

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


#ifdef CXX14_SUPPORT
#include "memory.h"

#include <memory>


#include "Matrix.h"
#include "RNGController.h"

using namespace std;
using namespace random_numbers;
namespace necsim
    class SpeciesList
        unsigned long list_size, max_size; // List size and maximum size of the cell (based on percentage cover).
        unsigned long next_active; // For calculating the wrapping, using the next and last system.
        vector<unsigned long> lineage_indices; // list of the active reference number, with zeros for empty cells.
        unsigned long nwrap; // The number of wrapping (next and last possibilities) that there are.

        ~SpeciesList() = default;

        void initialise(unsigned long maxsizein);

        // special case if just the max_size wants to be change, but want to maintain the lineage_indices variables.
        void setMaxsize(unsigned long maxsizein);

        void setSpecies(unsigned long index, unsigned long new_val);

        void setSpeciesEmpty(unsigned long index, unsigned long new_val);

        void setNext(unsigned long n);

        void setNwrap(unsigned long nr);

        unsigned long addSpecies(const unsigned long &new_spec);

        void deleteSpecies(unsigned long index);

        void decreaseNwrap();

        void increaseListSize();

        void increaseNwrap();

        void changePercentCover(unsigned long newmaxsize);

        unsigned long getRandLineage(const shared_ptr<RNGController> &rand_no);

        unsigned long getLineageIndex(unsigned long index) const;

        unsigned long getNext() const;

        unsigned long getNwrap() const;

        unsigned long getListSize() const;

        unsigned long getMaxSize() const;

        unsigned long getListLength() const;

        void wipeList();

        double getCoalescenceProbability() const;

        friend ostream &operator<<(ostream &os, const SpeciesList &r);

        friend istream &operator>>(istream &is, SpeciesList &r);