Empirical
Public Types | Public Member Functions | Protected Attributes | List of all members
emp::Systematics< ORG, ORG_INFO, DATA_STRUCT > Class Template Reference

A tool to track phylogenetic relationships among organisms. The systematics class tracks the relationships among all organisms based on the INFO_TYPE provided. If an offspring has the same value for INFO_TYPE as its parent, it is grouped into the same taxon. Otherwise a new Taxon is created and the old one is used as its parent in the phylogeny. If the provided INFO_TYPE is the organsism's genome, a traditional phylogeny is formed, with genotypes. If the organism's behavior/task set is used, then organisms are grouped by phenotypes. If the organsims's position is used, the evolutionary path through space is tracked. Any other aspect of organisms can be tracked this way as well. More...

#include <Systematics.h>

Inheritance diagram for emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >:
emp::SystematicsBase< ORG >

Public Types

using data_node_t = DataNode< double, data::Current, data::Info, data::Range, data::Stats, data::Pull >
 

Public Member Functions

 Systematics (fun_calc_info_t calc_taxon, bool _active=true, bool _anc=true, bool _all=false, bool _pos=true)
 
 Systematics (const Systematics &)=delete
 
 Systematics (Systematics &&)=default
 
 ~Systematics ()
 
void Update ()
 
void SetCalcInfoFun (fun_calc_info_t f)
 
std::unordered_set< Ptr< taxon_t >, hash_t > * GetActivePtr ()
 
const std::unordered_set< Ptr< taxon_t >, hash_t > & GetActive () const
 
const std::unordered_set< Ptr< taxon_t >, hash_t > & GetAncestors () const
 
size_t GetNumActive () const
 How many taxa are still active in the population? More...
 
size_t GetNumAncestors () const
 How many taxa are ancestors of living organisms (but have died out themselves)? More...
 
size_t GetNumOutside () const
 How many taxa are stored that have died out, as have their descendents? More...
 
size_t GetTreeSize () const
 How many taxa are in the current phylogeny? More...
 
size_t GetNumTaxa () const
 How many taxa are stored in total? More...
 
void SetNextParent (int pos)
 
void SetNextParent (Ptr< taxon_t > p)
 
SignalKey OnNew (std::function< void(Ptr< taxon_t >)> &fun)
 
SignalKey OnPrune (std::function< void(Ptr< taxon_t >)> &fun)
 
virtual data_ptr_t AddEvolutionaryDistinctivenessDataNode (const std::string &name="evolutionary_distinctiveness")
 
virtual data_ptr_t AddPairwiseDistanceDataNode (const std::string &name="pairwise_distances")
 
virtual data_ptr_t AddPhylogeneticDiversityDataNode (const std::string &name="phylogenetic_diversity")
 
virtual data_ptr_t AddDeleteriousStepDataNode (const std::string &name="deleterious_steps")
 
data_ptr_t AddDeleteriousStepDataNodeImpl (bool decoy, const std::string &name="deleterious_steps")
 
template<typename T = int>
data_ptr_t AddDeleteriousStepDataNodeImpl (typename std::enable_if< DATA_STRUCT::has_fitness_t::value, T >::type decoy, const std::string &name="deleterious_steps")
 
virtual data_ptr_t AddVolatilityDataNode (const std::string &name="volatility")
 
data_ptr_t AddVolatilityDataNodeImpl (bool decoy, const std::string &name="volatility")
 
template<typename T = int>
data_ptr_t AddVolatilityDataNodeImpl (typename std::enable_if< DATA_STRUCT::has_phen_t::value, T >::type decoy, const std::string &name="volatility")
 
virtual data_ptr_t AddUniqueTaxaDataNode (const std::string &name="unique_taxa")
 
data_ptr_t AddUniqueTaxaDataNodeImpl (bool decoy, const std::string &name="unique_taxa")
 
template<typename T = int>
data_ptr_t AddUniqueTaxaDataNodeImpl (typename std::enable_if< DATA_STRUCT::has_phen_t::value, T >::type decoy, const std::string &name="unique_taxa")
 
virtual data_ptr_t AddMutationCountDataNode (const std::string &name="mutation_count", const std::string &mutation="substitution")
 
data_ptr_t AddMutationCountDataNodeImpl (bool decoy, const std::string &name="mutation_count", const std::string &mutation="substitution")
 
template<typename T = int>
data_ptr_t AddMutationCountDataNodeImpl (typename std::enable_if< DATA_STRUCT::has_mutations_t::value, T >::type decoy, const std::string &name="mutation_count", const std::string &mutation="substitution")
 
Ptr< taxon_tGetTaxonAt (int id)
 
Ptr< taxon_tGetNextTaxonAt (int id)
 
int GetPhylogeneticDiversity () const
 
double GetTaxonDistinctiveness (Ptr< taxon_t > tax) const
 
double GetEvolutionaryDistinctiveness (Ptr< taxon_t > tax, double time) const
 
double GetMeanPairwiseDistance (bool branch_only=false) const
 
double GetSumPairwiseDistance (bool branch_only=false) const
 
double GetVariancePairwiseDistance (bool branch_only=false) const
 
emp::vector< double > GetPairwiseDistances (bool branch_only=false) const
 
int GetDistanceToRoot (Ptr< taxon_t > tax) const
 
int GetBranchesToRoot (Ptr< taxon_t > tax) const
 
Ptr< taxon_tGetMRCA () const
 Request a pointer to the Most-Recent Common Ancestor for the population. More...
 
int GetMRCADepth () const
 Request the depth of the Most-Recent Common Ancestor; return -1 for none. More...
 
void AddOrg (ORG &&org, int pos, int update=-1, bool next=false)
 
Ptr< taxon_tAddOrg (ORG &&org, int pos, Ptr< taxon_t > parent=nullptr, int update=-1, bool next=false)
 
Ptr< taxon_tAddOrg (ORG &&org, Ptr< taxon_t > parent=nullptr, int update=-1, bool next=false)
 
void AddOrg (ORG &org, int pos, int update=-1, bool next=false)
 
Ptr< taxon_tAddOrg (ORG &org, int pos, Ptr< taxon_t > parent=nullptr, int update=-1, bool next=false)
 
Ptr< taxon_tAddOrg (ORG &org, Ptr< taxon_t > parent=nullptr, int update=-1, bool next=false)
 
bool RemoveOrg (int pos)
 Remove an instance of an organism; track when it's gone. More...
 
bool RemoveOrg (Ptr< taxon_t > taxon)
 
bool RemoveNextOrg (int pos)
 Remove org from next population (for use with synchronous generations) More...
 
bool RemoveNextOrg (Ptr< taxon_t > taxon)
 
Ptr< taxon_tParent (Ptr< taxon_t > taxon) const
 Climb up a lineage... More...
 
void PrintStatus (std::ostream &os=std::cout) const
 Print details about the Systematics manager. More...
 
void PrintLineage (Ptr< taxon_t > taxon, std::ostream &os=std::cout) const
 Print whole lineage. More...
 
double CalcDiversity () const
 Calculate the genetic diversity of the population. More...
 
bool GetTrackSynchronous () const
 Are we tracking a synchronous population? More...
 
bool GetStoreActive () const
 Are we storing all taxa that are still alive in the population? More...
 
bool GetStoreAncestors () const
 Are we storing all taxa that are the ancestors of living organims in the population? More...
 
bool GetStoreOutside () const
 Are we storing all taxa that have died out, as have all of their descendants. More...
 
bool GetArchive () const
 Are we storing any taxa types that have died out? More...
 
bool GetStorePosition () const
 Are we storing the positions of taxa? More...
 
size_t GetTotalOrgs () const
 How many living organisms are currently being tracked? More...
 
size_t GetNumRoots () const
 How many independent trees are being tracked? More...
 
double GetAveDepth () const
 What is the average phylogenetic depth of organisms in the population? More...
 
void SetTrackSynchronous (bool new_val)
 Are we tracking organisms evolving in synchronous generations? More...
 
void SetStoreActive (bool new_val)
 Are we storing all taxa that are still alive in the population? More...
 
void SetStoreAncestors (bool new_val)
 Are we storing all taxa that are the ancestors of living organims in the population? More...
 
void SetStoreOutside (bool new_val)
 Are we storing all taxa that have died out, as have all of their descendants. More...
 
void SetArchive (bool new_val)
 Are we storing any taxa types that have died out? More...
 
void SetStorePosition (bool new_val)
 Are we storing the location of taxa? More...
 
data_ptr_t AddDataNode (const std::string &name)
 
data_ptr_t AddDataNode (std::function< emp::vector< double >()> pull_set_fun, const std::string &name)
 
data_ptr_t AddDataNode (std::function< double()> pull_fun, const std::string &name)
 
data_ptr_t GetDataNode (const std::string &name)
 

Protected Attributes

bool store_active
 Store all of the currently active taxa? More...
 
bool store_ancestors
 Store all of the direct ancestors from living taxa? More...
 
bool store_outside
 Store taxa that are extinct with no living descendants? More...
 
bool archive
 Set to true if we are supposed to do any archiving of extinct taxa. More...
 
bool store_position
 Keep a vector mapping positions to pointers. More...
 
bool track_synchronous
 Does this systematics manager need to keep track of current and next positions? More...
 
size_t org_count
 How many organisms are currently active? More...
 
size_t total_depth
 Sum of taxa depths for calculating average. More...
 
size_t num_roots
 How many distint injected ancestors are currently in population? More...
 
size_t next_id
 What ID value should the next new taxon have? More...
 
size_t curr_update
 
DataManager< double, data::Current, data::Info, data::Range, data::Stats, data::Pulldata_nodes
 

Detailed Description

template<typename ORG, typename ORG_INFO, typename DATA_STRUCT = emp::datastruct::no_data>
class emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >

A tool to track phylogenetic relationships among organisms. The systematics class tracks the relationships among all organisms based on the INFO_TYPE provided. If an offspring has the same value for INFO_TYPE as its parent, it is grouped into the same taxon. Otherwise a new Taxon is created and the old one is used as its parent in the phylogeny. If the provided INFO_TYPE is the organsism's genome, a traditional phylogeny is formed, with genotypes. If the organism's behavior/task set is used, then organisms are grouped by phenotypes. If the organsims's position is used, the evolutionary path through space is tracked. Any other aspect of organisms can be tracked this way as well.

Member Typedef Documentation

template<typename ORG >
using emp::SystematicsBase< ORG >::data_node_t = DataNode<double, data::Current, data::Info, data::Range, data::Stats, data::Pull>
inherited

Constructor & Destructor Documentation

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::Systematics ( fun_calc_info_t  calc_taxon,
bool  _active = true,
bool  _anc = true,
bool  _all = false,
bool  _pos = true 
)
inline

Contructor for Systematics; controls what information should be stored.

Parameters
store_activeShould living organisms' taxa be tracked? (typically yes!)
store_ancestorsShould ancestral organims' taxa be maintained? (yes for lineages!)
store_outsideShould all dead taxa be maintained? (typically no; it gets BIG!)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::Systematics ( const Systematics< ORG, ORG_INFO, DATA_STRUCT > &  )
delete
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::Systematics ( Systematics< ORG, ORG_INFO, DATA_STRUCT > &&  )
default
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::~Systematics ( )
inline

Member Function Documentation

template<typename ORG >
data_ptr_t emp::SystematicsBase< ORG >::AddDataNode ( const std::string &  name)
inlineinherited
template<typename ORG >
data_ptr_t emp::SystematicsBase< ORG >::AddDataNode ( std::function< emp::vector< double >()>  pull_set_fun,
const std::string &  name 
)
inlineinherited
template<typename ORG >
data_ptr_t emp::SystematicsBase< ORG >::AddDataNode ( std::function< double()>  pull_fun,
const std::string &  name 
)
inlineinherited
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddDeleteriousStepDataNode ( const std::string &  name = "deleterious_steps")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddDeleteriousStepDataNodeImpl ( bool  decoy,
const std::string &  name = "deleterious_steps" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
template<typename T = int>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddDeleteriousStepDataNodeImpl ( typename std::enable_if< DATA_STRUCT::has_fitness_t::value, T >::type  decoy,
const std::string &  name = "deleterious_steps" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddEvolutionaryDistinctivenessDataNode ( const std::string &  name = "evolutionary_distinctiveness")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddMutationCountDataNode ( const std::string &  name = "mutation_count",
const std::string &  mutation = "substitution" 
)
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddMutationCountDataNodeImpl ( bool  decoy,
const std::string &  name = "mutation_count",
const std::string &  mutation = "substitution" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
template<typename T = int>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddMutationCountDataNodeImpl ( typename std::enable_if< DATA_STRUCT::has_mutations_t::value, T >::type  decoy,
const std::string &  name = "mutation_count",
const std::string &  mutation = "substitution" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &&  org,
int  pos,
int  update = -1,
bool  next = false 
)
virtual

Add information about a new organism, including its stored info and parent's taxon; If you would like the systematics manager to track taxon age, you can also supply the update at which the taxon is being added. return a pointer for the associated taxon.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &&  org,
int  pos,
Ptr< taxon_t parent = nullptr,
int  update = -1,
bool  next = false 
)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &&  org,
Ptr< taxon_t parent = nullptr,
int  update = -1,
bool  next = false 
)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &  org,
int  pos,
int  update = -1,
bool  next = false 
)
virtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &  org,
int  pos,
Ptr< taxon_t parent = nullptr,
int  update = -1,
bool  next = false 
)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddOrg ( ORG &  org,
Ptr< taxon_t parent = nullptr,
int  update = -1,
bool  next = false 
)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddPairwiseDistanceDataNode ( const std::string &  name = "pairwise_distances")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddPhylogeneticDiversityDataNode ( const std::string &  name = "phylogenetic_diversity")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddUniqueTaxaDataNode ( const std::string &  name = "unique_taxa")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddUniqueTaxaDataNodeImpl ( bool  decoy,
const std::string &  name = "unique_taxa" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
template<typename T = int>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddUniqueTaxaDataNodeImpl ( typename std::enable_if< DATA_STRUCT::has_phen_t::value, T >::type  decoy,
const std::string &  name = "unique_taxa" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
virtual data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddVolatilityDataNode ( const std::string &  name = "volatility")
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddVolatilityDataNodeImpl ( bool  decoy,
const std::string &  name = "volatility" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
template<typename T = int>
data_ptr_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::AddVolatilityDataNodeImpl ( typename std::enable_if< DATA_STRUCT::has_phen_t::value, T >::type  decoy,
const std::string &  name = "volatility" 
)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::CalcDiversity ( ) const
virtual

Calculate the genetic diversity of the population.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
const std::unordered_set< Ptr<taxon_t>, hash_t >& emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetActive ( ) const
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
std::unordered_set< Ptr<taxon_t>, hash_t >* emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetActivePtr ( )
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
const std::unordered_set< Ptr<taxon_t>, hash_t >& emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetAncestors ( ) const
inline
template<typename ORG >
bool emp::SystematicsBase< ORG >::GetArchive ( ) const
inlineinherited

Are we storing any taxa types that have died out?

template<typename ORG >
double emp::SystematicsBase< ORG >::GetAveDepth ( ) const
inlineinherited

What is the average phylogenetic depth of organisms in the population?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
int emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetBranchesToRoot ( Ptr< taxon_t tax) const
inline

Counts the number of branching points leading to multiple extant taxa between

Parameters
taxand the most-recent common ancestor (or the root of its subtree, if no MRCA exists). This is useful because a lot of stats for phylogenies are designed for phylogenies reconstructed from extant taxa. These phylogenies generally only contain branching points, rather than every ancestor along the way to the current taxon.
template<typename ORG >
data_ptr_t emp::SystematicsBase< ORG >::GetDataNode ( const std::string &  name)
inlineinherited
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
int emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetDistanceToRoot ( Ptr< taxon_t tax) const
inline

Counts the total number of ancestors between

Parameters
taxand MRCA, if there is one. If there is no common ancestor, distance to the root of this tree is calculated instead.
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetEvolutionaryDistinctiveness ( Ptr< taxon_t tax,
double  time 
) const
inline

This metric (from Isaac, 2007; reviewd in Winter et al., 2013) measures how distinct

Parameters
taxis from the rest of the population, weighted for the amount of unique evolutionary history that it represents.

To quantify length of evolutionary history, this method needs

Parameters
timethe current time, in whatever units time is being measured in when taxa are added to the systematics manager. Note that passing a time in the past will produce innacurate results (since we don't know what the state of the tree was at that time).

Assumes the tree is all connected. Will return -1 if this assumption isn't met.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetMeanPairwiseDistance ( bool  branch_only = false) const
inlinevirtual

Calculates mean pairwise distance between extant taxa (Webb and Losos, 2000). This measurement is also called Average Taxonomic Diversity (Warwick and Clark, 1998) (for demonstration of equivalence see Tucker et al, 2016). This measurment tells you about the amount of distinctness in the community as a whole.

Parameters
branch_onlyonly counts distance in terms of nodes that represent a branch between two extant taxa (poentially useful for comparison to biological data, where non-branching nodes generally cannot be inferred).

This measurement assumes that the tree is fully connected. Will return -1 if this is not the case.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetMRCA ( ) const

Request a pointer to the Most-Recent Common Ancestor for the population.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
int emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetMRCADepth ( ) const
virtual

Request the depth of the Most-Recent Common Ancestor; return -1 for none.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
Ptr<taxon_t> emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetNextTaxonAt ( int  id)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
size_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetNumActive ( ) const
inlinevirtual

How many taxa are still active in the population?

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
size_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetNumAncestors ( ) const
inlinevirtual

How many taxa are ancestors of living organisms (but have died out themselves)?

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
size_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetNumOutside ( ) const
inlinevirtual

How many taxa are stored that have died out, as have their descendents?

Implements emp::SystematicsBase< ORG >.

template<typename ORG >
size_t emp::SystematicsBase< ORG >::GetNumRoots ( ) const
inlineinherited

How many independent trees are being tracked?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
size_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetNumTaxa ( ) const
inlinevirtual

How many taxa are stored in total?

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
emp::vector<double> emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetPairwiseDistances ( bool  branch_only = false) const
inlinevirtual

Calculates a vector of all pairwise distances between extant taxa.

Parameters
branch_onlyonly counts distance in terms of nodes that represent a branch between two extant taxa (poentially useful for comparison to biological data, where non-branching nodes generally cannot be inferred).

This method assumes that the tree is fully connected. Will return -1 if this is not the case.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
int emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetPhylogeneticDiversity ( ) const
inlinevirtual

From (Faith 1992, reviewed in Winters et al., 2013), phylogenetic diversity is the sum of edges in the minimal spanning tree connected the taxa you're calculating diversity of.

This calculates phylogenetic diversity for all extant taxa in the tree, assuming all edges from parent to child have a length of one. Possible extensions to this function that might be useful in the future include:

  • Pass it a set of taxon_t pointers and have it calculate PD for just those taxa
  • Enable calculation of branch lengths by amount of time that elapsed between origination of parent and origination of offspring
  • Enable a paleontology compatibility mode where only branching points are calculated

Implements emp::SystematicsBase< ORG >.

template<typename ORG >
bool emp::SystematicsBase< ORG >::GetStoreActive ( ) const
inlineinherited

Are we storing all taxa that are still alive in the population?

template<typename ORG >
bool emp::SystematicsBase< ORG >::GetStoreAncestors ( ) const
inlineinherited

Are we storing all taxa that are the ancestors of living organims in the population?

template<typename ORG >
bool emp::SystematicsBase< ORG >::GetStoreOutside ( ) const
inlineinherited

Are we storing all taxa that have died out, as have all of their descendants.

template<typename ORG >
bool emp::SystematicsBase< ORG >::GetStorePosition ( ) const
inlineinherited

Are we storing the positions of taxa?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetSumPairwiseDistance ( bool  branch_only = false) const
inlinevirtual

Calculates summed pairwise distance between extant taxa. Tucker et al 2017 points out that this is a measure of phylogenetic richness.

Parameters
branch_onlyonly counts distance in terms of nodes that represent a branch between two extant taxa (poentially useful for comparison to biological data, where non-branching nodes generally cannot be inferred).

This measurement assumes that the tree is fully connected. Will return -1 if this is not the case.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
Ptr<taxon_t> emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetTaxonAt ( int  id)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetTaxonDistinctiveness ( Ptr< taxon_t tax) const
inline

This is a metric of how distinct

Parameters
taxis from the rest of the population.

(From Vane-Wright et al., 1991; reviewed in Winter et al., 2013)

template<typename ORG >
size_t emp::SystematicsBase< ORG >::GetTotalOrgs ( ) const
inlineinherited

How many living organisms are currently being tracked?

template<typename ORG >
bool emp::SystematicsBase< ORG >::GetTrackSynchronous ( ) const
inlineinherited

Are we tracking a synchronous population?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
size_t emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetTreeSize ( ) const
inlinevirtual

How many taxa are in the current phylogeny?

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
double emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::GetVariancePairwiseDistance ( bool  branch_only = false) const
inlinevirtual

Calculates variance of pairwise distance between extant taxa. Tucker et al 2017 points out that this is a measure of phylogenetic regularity.

Parameters
branch_onlyonly counts distance in terms of nodes that represent a branch between two extant taxa (poentially useful for comparison to biological data, where non-branching nodes generally cannot be inferred).

This measurement assumes that the tree is fully connected. Will return -1 if this is not the case.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
SignalKey emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::OnNew ( std::function< void(Ptr< taxon_t >)> &  fun)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
SignalKey emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::OnPrune ( std::function< void(Ptr< taxon_t >)> &  fun)
inline

Privide a function for Systematics to call each time a taxon is about to be pruned. Trigger: Taxon is about to be killed Argument: Pounter to taxon

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
Ptr< typename Systematics< ORG, ORG_INFO, DATA_STRUCT >::taxon_t > emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::Parent ( Ptr< taxon_t taxon) const

Climb up a lineage...

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::PrintLineage ( Ptr< taxon_t taxon,
std::ostream &  os = std::cout 
) const

Print whole lineage.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::PrintStatus ( std::ostream &  os = std::cout) const
virtual

Print details about the Systematics manager.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
bool emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::RemoveNextOrg ( int  pos)
virtual

Remove org from next population (for use with synchronous generations)

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
bool emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::RemoveNextOrg ( Ptr< taxon_t taxon)
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
bool emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::RemoveOrg ( int  pos)
virtual

Remove an instance of an organism; track when it's gone.

Implements emp::SystematicsBase< ORG >.

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT >
bool emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::RemoveOrg ( Ptr< taxon_t taxon)
template<typename ORG >
void emp::SystematicsBase< ORG >::SetArchive ( bool  new_val)
inlineinherited

Are we storing any taxa types that have died out?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::SetCalcInfoFun ( fun_calc_info_t  f)
inline
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::SetNextParent ( int  pos)
inlinevirtual
template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::SetNextParent ( Ptr< taxon_t p)
inline
template<typename ORG >
void emp::SystematicsBase< ORG >::SetStoreActive ( bool  new_val)
inlineinherited

Are we storing all taxa that are still alive in the population?

template<typename ORG >
void emp::SystematicsBase< ORG >::SetStoreAncestors ( bool  new_val)
inlineinherited

Are we storing all taxa that are the ancestors of living organims in the population?

template<typename ORG >
void emp::SystematicsBase< ORG >::SetStoreOutside ( bool  new_val)
inlineinherited

Are we storing all taxa that have died out, as have all of their descendants.

template<typename ORG >
void emp::SystematicsBase< ORG >::SetStorePosition ( bool  new_val)
inlineinherited

Are we storing the location of taxa?

template<typename ORG >
void emp::SystematicsBase< ORG >::SetTrackSynchronous ( bool  new_val)
inlineinherited

Are we tracking organisms evolving in synchronous generations?

template<typename ORG , typename ORG_INFO , typename DATA_STRUCT = emp::datastruct::no_data>
void emp::Systematics< ORG, ORG_INFO, DATA_STRUCT >::Update ( )
inlinevirtual

Member Data Documentation

template<typename ORG >
bool emp::SystematicsBase< ORG >::archive
protectedinherited

Set to true if we are supposed to do any archiving of extinct taxa.

template<typename ORG >
size_t emp::SystematicsBase< ORG >::curr_update
protectedinherited
template<typename ORG >
DataManager<double, data::Current, data::Info, data::Range, data::Stats, data::Pull> emp::SystematicsBase< ORG >::data_nodes
protectedinherited
template<typename ORG >
size_t emp::SystematicsBase< ORG >::next_id
protectedinherited

What ID value should the next new taxon have?

template<typename ORG >
size_t emp::SystematicsBase< ORG >::num_roots
protectedinherited

How many distint injected ancestors are currently in population?

template<typename ORG >
size_t emp::SystematicsBase< ORG >::org_count
protectedinherited

How many organisms are currently active?

template<typename ORG >
bool emp::SystematicsBase< ORG >::store_active
protectedinherited

Store all of the currently active taxa?

template<typename ORG >
bool emp::SystematicsBase< ORG >::store_ancestors
protectedinherited

Store all of the direct ancestors from living taxa?

template<typename ORG >
bool emp::SystematicsBase< ORG >::store_outside
protectedinherited

Store taxa that are extinct with no living descendants?

template<typename ORG >
bool emp::SystematicsBase< ORG >::store_position
protectedinherited

Keep a vector mapping positions to pointers.

template<typename ORG >
size_t emp::SystematicsBase< ORG >::total_depth
protectedinherited

Sum of taxa depths for calculating average.

template<typename ORG >
bool emp::SystematicsBase< ORG >::track_synchronous
protectedinherited

Does this systematics manager need to keep track of current and next positions?


The documentation for this class was generated from the following file: