19 const vector<double>& rates)
21 size_t numberOfSites = rates.size();
22 vector<unique_ptr<Site>> vs(numberOfSites);
23 for (
size_t i = 0; i < numberOfSites; ++i)
26 s->setCoordinate(
static_cast<int>(i));
29 auto sites = make_unique<VectorSiteContainer>(vs, simulator.
getAlphabet());
37 const vector<double>& rates,
38 const vector<size_t>& states)
40 size_t numberOfSites = rates.size();
41 if (states.size() != numberOfSites)
42 throw Exception(
"SequenceSimulationTools::simulateSites., 'rates' and 'states' must have the same length.");
43 vector<unique_ptr<Site>> vs(numberOfSites);
44 for (
size_t i = 0; i < numberOfSites; ++i)
47 s->setCoordinate(
static_cast<int>(i));
51 auto sites = make_unique<VectorSiteContainer>(vs, simulator.
getAlphabet());
59 const vector<size_t>& states)
61 size_t numberOfSites = states.size();
62 vector<unique_ptr<Site>> vs(numberOfSites);
63 for (
size_t i = 0; i < numberOfSites; ++i)
66 s->setCoordinate(
static_cast<int>(i));
70 auto sites = make_unique<VectorSiteContainer>(vs, simulator.
getAlphabet());
The SequenceSimulator interface. SequenceSimulator classes can simulate whole datasets.
virtual std::vector< std::string > getSequenceNames() const =0
virtual const SiteSimulatorInterface & siteSimulator(size_t pos) const =0
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
virtual std::unique_ptr< Site > simulateSite() const =0
Defines the basic types of data flow nodes.