9 #ifndef EMP_EVO_WORLD_OUTPUT_H 10 #define EMP_EVO_WORLD_OUTPUT_H 19 template <
typename WORLD_TYPE>
21 auto & file = world.SetupFile(fpath);
22 auto sys = world.GetSystematics(systematics_id);
24 sys->AddEvolutionaryDistinctivenessDataNode();
25 sys->AddPairwiseDistanceDataNode();
26 sys->AddPhylogeneticDiversityDataNode();
28 std::function<size_t(void)> get_update = [&world](){
return world.GetUpdate();};
30 file.
AddFun(get_update,
"update",
"Update");
31 file.AddStats(*sys->GetDataNode(
"evolutionary_distinctiveness") ,
"evolutionary_distinctiveness",
"evolutionary distinctiveness for a single update",
true,
true);
32 file.AddStats(*sys->GetDataNode(
"pairwise_distance"),
"pairwise_distance",
"pairwise distance for a single update",
true,
true);
33 file.AddCurrent(*sys->GetDataNode(
"phylogenetic_diversity"),
"current_phylogenetic_diversity",
"current phylogenetic_diversity",
true,
true);
34 file.PrintHeaderKeys();
38 template <
typename WORLD_TYPE>
40 auto & file = world.SetupFile(fpath);
41 auto sys = world.GetSystematics(systematics_id);
43 for (
size_t i = 0; i < mut_types.size(); i++) {
44 sys->AddMutationCountDataNode(mut_types[i]+
"_mut_count", mut_types[i]);
47 auto node = sys->AddDeleteriousStepDataNode();
48 sys->AddVolatilityDataNode();
49 sys->AddUniqueTaxaDataNode();
51 std::function<size_t(void)> get_update = [&world](){
return world.GetUpdate();};
53 file.
AddFun(get_update,
"update",
"Update");
54 for (
size_t i = 0; i < mut_types.size(); i++) {
55 file.AddStats(*sys->GetDataNode(mut_types[i]+
"_mut_count"), mut_types[i] +
"_mutations_on_lineage",
"counts of" + mut_types[i] +
"mutations along each lineage",
true,
true);
58 file.AddStats(*sys->GetDataNode(
"deleterious_steps"),
"deleterious_steps",
"counts of deleterious steps along each lineage",
true,
true);
59 file.AddStats(*sys->GetDataNode(
"volatility"),
"taxon_volatility",
"counts of changes in taxon along each lineage",
true,
true);
60 file.AddStats(*sys->GetDataNode(
"unique_taxa"),
"unique_taxa",
"counts of unique taxa along each lineage",
true,
true);
61 file.PrintHeaderKeys();
DataFile & AddPhylodiversityFile(WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="phylodiversity.csv")
Definition: World_output.h:20
Simple functions to manipulate strings.
DataFile objects use DataNode objects to dynamically fill out file contents.
A drop-in wrapper for std::vector; adds on bounds checking in debug mode.
If we are in emscripten, make sure to include the header.
Definition: array.h:37
DataFile & AddLineageMutationFile(WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="lineage_mutations.csv", emp::vector< std::string > mut_types={"substitution"})
Definition: World_output.h:39
size_t AddFun(const std::function< T()> &fun, const std::string &key="", const std::string &desc="")
Add a function that returns a value to be printed to the file.
Definition: DataFile.h:163
Definition: DataFile.h:32