bpp-phyl3 3.0.0
SimpleSubstitutionProcessSequenceSimulator.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
6
7// From boo-seq:
9
10using namespace bpp;
11using namespace std;
12
13/******************************************************************************/
14
15unique_ptr<SiteContainerInterface> SimpleSubstitutionProcessSequenceSimulator::simulate(
16 size_t numberOfSites) const
17{
18 auto seqNames = siteSim_->getSequenceNames();
19 auto sites = make_unique<VectorSiteContainer>(seqNames, getAlphabet());
20 sites->setSequenceNames(seqNames, true);
21 for (size_t j = 0; j < numberOfSites; ++j)
22 {
23 auto site = siteSim_->simulateSite();
24 site->setCoordinate(static_cast<int>(j));
25 sites->addSite(site);
26 }
27 return sites;
28}
29
30/******************************************************************************/
std::shared_ptr< const Alphabet > getAlphabet() const override
Defines the basic types of data flow nodes.