bpp-phyl3  3.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
10 using namespace bpp;
11 using namespace std;
12 
13 /******************************************************************************/
14 
15 unique_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::unique_ptr< SiteContainerInterface > simulate(size_t numberOfSites) const override
Defines the basic types of data flow nodes.