13 std::shared_ptr<BranchModelInterface> model,
14 std::shared_ptr<DiscreteDistributionInterface> rdist,
15 std::shared_ptr<const PhyloTree> tree,
16 std::shared_ptr<FrequencySetInterface> rootFrequencies) :
23 throw Exception(
"RateAcrossSitesSubstitutionProcess. A model instance must be provided.");
25 throw Exception(
"RateAcrossSitesSubstitutionProcess. A rate distribution instance must be provided.");
34 std::shared_ptr<BranchModelInterface> model,
35 std::shared_ptr<DiscreteDistributionInterface> rdist,
36 std::shared_ptr<ParametrizablePhyloTree> tree,
37 std::shared_ptr<FrequencySetInterface> rootFrequencies) :
44 throw Exception(
"RateAcrossSitesSubstitutionProcess. A model instance must be provided.");
46 throw Exception(
"RateAcrossSitesSubstitutionProcess. A rate distribution instance must be provided.");
57 model_(rassp.model_->clone()),
58 rDist_(rassp.rDist_->clone())
61 modelScenario_->changeModel(std::dynamic_pointer_cast<MixedTransitionModelInterface>(rassp.
model_), std::dynamic_pointer_cast<MixedTransitionModelInterface>(
model_));
73 modelScenario_->changeModel(std::dynamic_pointer_cast<MixedTransitionModelInterface>(rassp.
model_), std::dynamic_pointer_cast<MixedTransitionModelInterface>(
model_));
80 auto vmod = modelpath->getModels();
86 throw Exception(
"RateAcrossSitesSubstitutionProcess::setModelScenario: model path must have exactly one model.");
89 throw Exception(
"RateAcrossSitesSubstitutionProcess::setModelScenario: models are different " + vmod[0]->getNModel(0)->getName() +
" != " +
model_->getName());
97 rDist_->matchParametersValues(pl);
98 model_->matchParametersValues(pl);
A partial implementation of the SubstitutionProcess interface.
std::shared_ptr< ModelScenario > modelScenario_
void fireParameterChanged(const ParameterList &pl)
AbsractParametrizable interface.
AbstractAutonomousSubstitutionProcess & operator=(const AbstractAutonomousSubstitutionProcess &asp)
void addParameters_(const ParameterList ¶meters)
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
virtual const ParameterList & getIndependentParameters() const=0
void setModelScenario(std::shared_ptr< ModelScenario > modelpath) override
Set the modelPath, after checking it is valid (ie modelpath has only the model of the process).
RateAcrossSitesSubstitutionProcess & operator=(const RateAcrossSitesSubstitutionProcess &rassp)
void fireParameterChanged(const ParameterList &pl) override
AbsractParametrizable interface.
std::shared_ptr< DiscreteDistributionInterface > rDist_
std::shared_ptr< BranchModelInterface > model_
const BranchModelInterface & model(size_t n) const override
RateAcrossSitesSubstitutionProcess(std::shared_ptr< BranchModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rdist, std::shared_ptr< const PhyloTree > tree=nullptr, std::shared_ptr< FrequencySetInterface > rootFrequencies=nullptr)
Defines the basic types of data flow nodes.