18 #include "../Simulation/MutationProcess.h"
34 tree_(make_shared<
PhyloTree>(drl->substitutionProcess().parametrizablePhyloTree())),
36 fractionalProbabilities_(),
37 ConditionalProbabilities_(),
39 numOfMappings_(numOfMappings)
97 shared_ptr<PhyloTree> expectedMapping(make_shared<PhyloTree>(*
tree_));
152 return expectedMapping;
183 shared_ptr<PhyloTree> expectedMapping(make_shared<PhyloTree>(*
tree_));
282 return expectedMapping;
295 BppInteger stateProperty(
static_cast<int>(state));
304 for (
auto& node:nodes)
306 if (!node->hasName())
316 auto leaves = mapping->getAllLeaves();
318 for (
auto& leaf: leaves)
320 string nodeName = leaf->getName();
vector< vector< double > > VVDouble
virtual NodeIndex getNodeIndex(const std::shared_ptr< N > nodeObject) const=0
virtual std::vector< std::shared_ptr< N > > getAllInnerNodes() const=0
This class is used by MutationProcess to store detailed results of simulations.
Clonable * getProperty(const std::string &name)
void setProperty(const std::string &name, const Clonable &property)
Set/add a node property.
void giveNamesToInternalNodes(PhyloTree &tree)
void updateBranchMapping(PhyloNode *son, const MutationPath &branchMapping)
void setExpectedAncestrals(shared_ptr< PhyloTree > expectedMapping, VVDouble &posteriorProbabilities)
void setNodeState(PhyloNode *node, size_t state)
void sampleAncestrals(shared_ptr< PhyloTree > mapping)
void sampleMutationsGivenAncestralsPerBranch(PhyloNode *son, size_t maxIterNum=10000)
size_t sampleState(const VDouble &distibution)
int getNodeState(const PhyloNode *node) const
void computeFractionals()
void ComputeConditionals()
std::shared_ptr< PhyloTree > generateAnalyticExpectedMapping(size_t divMethod=0)
Creates a single expected (i.e, average) history based the rewards provided by the algorithm of Minin...
void updateBranchByDwellingTimes(PhyloNode *node, VDouble &dwellingTimes, VVDouble &posteriorProbabilities, size_t divMethod=0)
void computeStatesFrequencies(VVDouble &ancestralStatesFreuquencies, vector< shared_ptr< PhyloTree >> &mappings)
StochasticMapping(std::shared_ptr< LikelihoodCalculationSingleProcess > drl, size_t numOfMappings=10000)
std::shared_ptr< PhyloTree > generateExpectedMapping(std::vector< std::shared_ptr< PhyloTree >> &mappings, size_t divMethod=0)
Creates a single expected (i.e, average) history based on a given set of mappings steps....
void generateStochasticMapping(std::vector< std::shared_ptr< PhyloTree >> &mappings)
void setLeafsStates(std::shared_ptr< PhyloTree > mapping)
std::shared_ptr< PhyloTree > tree_
void sampleMutationsGivenAncestrals(shared_ptr< PhyloTree > mapping)
std::string toString(T t)
Defines the basic types of data flow nodes.