11 std::shared_ptr<BranchModelInterface> model,
12 std::shared_ptr<ParametrizablePhyloTree> tree,
13 std::shared_ptr<FrequencySetInterface> rootFrequencies) :
19 throw Exception(
"SimpleSubstitutionProcess. A model instance must be provided.");
26 std::shared_ptr<BranchModelInterface> model,
27 std::shared_ptr<const PhyloTree> tree,
28 std::shared_ptr<FrequencySetInterface> rootFrequencies) :
34 throw Exception(
"SimpleSubstitutionProcess. A model instance must be provided.");
43 model_(ssp.model_->clone())
46 modelScenario_->changeModel(dynamic_pointer_cast<MixedTransitionModelInterface>(ssp.
model_), dynamic_pointer_cast<MixedTransitionModelInterface>(
model_));
56 modelScenario_->changeModel(dynamic_pointer_cast<MixedTransitionModelInterface>(ssp.
model_), dynamic_pointer_cast<MixedTransitionModelInterface>(
model_));
63 auto vmod = modelpath->getModels();
69 throw Exception(
"SimpleSubstitutionProcess::setModelScenario: model path must have exactly one model.");
71 auto mixed_ = dynamic_pointer_cast<MixedTransitionModelInterface>(
model_);
73 throw Exception(
"SimpleSubstitutionProcess::setModelScenario: model must be mixed.");
75 if (vmod[0] != mixed_)
76 throw Exception(
"SimpleSubstitutionProcess::setModelScenario: models are different " + vmod[0]->getNModel(0)->getName() +
" != " + mixed_->getNModel(0)->getName());
86 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
Space and time homogeneous substitution process, without mixture.
std::shared_ptr< BranchModelInterface > model_
const BranchModelInterface & model(unsigned int nodeId, size_t classIndex) const override
Get the substitution model corresponding to a certain branch, site pattern, and model class.
void fireParameterChanged(const ParameterList &pl) override
AbsractParametrizable interface.
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).
SimpleSubstitutionProcess & operator=(const SimpleSubstitutionProcess &ssp)
SimpleSubstitutionProcess(std::shared_ptr< BranchModelInterface > model, std::shared_ptr< const PhyloTree > tree=nullptr, std::shared_ptr< FrequencySetInterface > rootFrequencies=nullptr)
Defines the basic types of data flow nodes.