Struct MetacommunitiesArray

Struct Documentation

struct MetacommunitiesArray

Contains an array of MetacommunityParameters that have been applied to the coalescence tree.

Public Functions

MetacommunitiesArray()

Default constructor.

~MetacommunitiesArray()

Trivial destructor.

vector<shared_ptr<MetacommunityParameters>>::iterator begin()

Support for range-based for loop iteration over metacomm_parameters.

Return
the start of the parameters vector

vector<shared_ptr<MetacommunityParameters>>::iterator end()

Support for range-based for loop iteration over metacomm_parameters.

Return
the end of the parameters vector

vector<shared_ptr<MetacommunityParameters>>::const_iterator begin() const

Support for range-based for loop iteration over metacomm_parameters.

Return
the start of the parameters vector

vector<shared_ptr<MetacommunityParameters>>::const_iterator end() const

Support for range-based for loop iteration over metacomm_parameters.

Return
the end of the parameters vector

void pushBack(const unsigned long &reference, const unsigned long &metacommunity_size, const long double &speciation_rate, const string &option, const unsigned long &external_reference)

Adds an extra CommunityParameters object to the calc_array vector with the supplied variables.

Parameters
  • reference: the reference for this set of metacommunity parameters
  • speciation_rate: the speciation rate used in generation of the metacommunity
  • metacommunity_size: the size of the metacommunity used
  • option: the metacommunity option (“simulated”, “analytical” or a path to a database)
  • external_reference: the reference for the external database

void pushBack(shared_ptr<MetacommunityParameters> tmp_param)

Adds the provided PastMetacommunityParameters object to the calc_array vector.

Parameters
  • tmp_param: the set of metacommunity parameters to add

void clear()

Wipes the internal vector.

unsigned long size()

Gets the size of the array.

Return
the number of metacommunity parameters that have been added

bool empty()

Check if the array is empty.

Return
true if the array has no elements in

unsigned long addNew(const unsigned long &metacommunity_size, const long double &speciation_rate, const string &option, const unsigned long &external_reference)

Adds a new metacommunities calculation paremeters reference, with a new unique reference.

Return
the new reference number, which should be unique
Parameters
  • speciation_rate: the speciation rate of the new calculation
  • metacommunity_size: the size of the metacommunity in the new calculation
  • option: the metacommunity option (“simulated”, “analytical” or a path to a database)
  • external_reference: the reference for the external database

unsigned long addNew(const MetacommunityParameters &metacomm_in)

Adds a new set of metacommunity parameters to the array.

Return
the new reference number, which should be unique
Parameters
  • metacomm_in: the new metacommunity parameters to add

bool hasOption(const unsigned long &metacommunity_size, const long double &speciation_rate, const string &option, const unsigned long &external_reference)

Checks whether the calculation with the supplied variables has already been performed.

Return
true if the reference exists in past metacommunity parameters
Parameters
  • speciation_rate: the speciation rate to check for
  • metacommunity_size: the size of metacommunity to check for
  • option: the metacommunity option (“simulated”, “analytical” or a path to a database)
  • external_reference: the reference for the external database

bool hasOption(unsigned long reference)

Checks whether the calculation with the supplied reference has already been performed. Overloaded version for checking references.

Return
true if the reference exists in past metacommunity parameters
Parameters
  • reference: the reference to check for in past metacommunity parameters

bool hasOption(const MetacommunityParameters &metacomm_in)

Checks whether the calculation with the supplied reference has already been performed.

Return
true if the metacommunity already exists in past metacommunity parameters
Parameters
  • metacomm_in: the metacommunity parameters to check for

unsigned long getReference(const unsigned long &metacommunity_size, const long double &speciation_rate, const string &option, const unsigned long &external_reference)

Gets the metacommunity reference for the provided parameters, or returns 0 if it doesn’t exist.

Return
the metacommunity reference number, or 0 if it doesn’t exist
Parameters
  • speciation_rate: the metacommunity speciation rate to obtain for
  • metacommunity_size: the metacommunity size to apply for
  • fragment: bool for checking if fragments were used
  • option: the metacommunity option (“simulated”, “analytical” or a path to a database)
  • external_reference: the reference for the external database

unsigned long getReference(const MetacommunityParameters &metacomm_parameters)

Gets the metacommunity reference for the provided parameters, or returns 0 if it doesn’t exist.

Return
the metacommunity reference number, or 0 if it doesn’t exist
Parameters
  • metacomm_parameters: the parameters to check for

void addNull()

Adds an empty metacommunity parameters option.

bool hasMetacommunityOption()

Determines if the array has any Metacommunity options (other than a null option).

Return

Public Members

vector<shared_ptr<MetacommunityParameters>> metacomm_parameters