Struct CommunitiesArray¶
- Defined in File parameters.h
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 parametersspeciation_rate
: the speciation rate of the past calculationtime
: the time of the past calculationfragment
: bool of whether fragments were used in the past calculationmetacommunity_reference
: reference for the metacommunity parameters, or 0 if no metacommunityprotracted_params
: protracted speciation parameters to add
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 calculationtime
: the time used in the new calculationfragment
: true if fragments were used in the new calculationmetacommunity_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 fortime
: the time to check forfragment
: bool for checking if fragments were usedmetacommunity_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.
-