Struct CommunitiesArray

Struct Documentation

struct CommunitiesArray

A structure for containing an array of previous calculation information, including which fragments have been already calculated for.

Public Functions

CommunitiesArray()

Default constructor.

~CommunitiesArray()

Trivial destructor.

void pushBack(unsigned long reference, long double speciation_rate, long double time, bool fragment, unsigned long metacommunity_reference, const ProtractedSpeciationParameters &protracted_params)

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

Parameters
  • reference: the reference for this set of community parameters
  • speciation_rate: the speciation rate of the past calculation
  • time: the time of the past calculation
  • fragment: bool of whether fragments were used in the past calculation
  • metacommunity_reference: reference for the metacommunity parameters, or 0 if no metacommunity
  • protracted_params: protracted speciation parameters to add

void pushBack(shared_ptr<CommunityParameters> tmp_param)

Adds the provided CommunityParameters object to the calc_array vector.

Parameters
  • tmp_param: the set of community parameters to add

shared_ptr<CommunityParameters> addNew(long double speciation_rate, long double time, bool fragment, unsigned long metacommunity_reference, const ProtractedSpeciationParameters &protracted_params)

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

Return
reference to the new CommunityParameters object added
Parameters
  • speciation_rate: the speciation rate of the new calculation
  • time: the time used in the new calculation
  • fragment: true if fragments were used in the new calculation
  • metacommunity_reference: the reference to the set of metacommunity parameters (0 for none)
  • protracted_params: protracted speciation parameters to add

bool hasPair(long double speciation_rate, double time, bool fragment, unsigned long metacommunity_reference, const ProtractedSpeciationParameters &protracted_params)

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

Note
Return
true if the reference exists in past community parameters
Parameters
  • speciation_rate: the speciation rate to check for
  • time: the time to check for
  • fragment: bool for checking if fragments were used
  • metacommunity_reference: the reference to the set of metacommunity parameters (0 for none)
  • protracted_params: protracted speciation parameters to add

Public Members

vector<shared_ptr<CommunityParameters>> comm_parameters

The array of CommunityParameters which have been stored.