43 #include <Bpp/Seq/Container/VectorSiteContainer.h> 50 size_t numberOfSites = rates.size();
51 vector<const Site*> vs(numberOfSites);
52 for (
size_t i = 0; i < numberOfSites; i++)
55 s->setPosition(static_cast<int>(i));
58 SiteContainer* sites =
new VectorSiteContainer(vs, simulator.
getAlphabet());
61 for (
size_t i = 0; i < numberOfSites; i++)
72 size_t numberOfSites = rates.size();
73 if (states.size() != numberOfSites)
74 throw Exception(
"SequenceSimulationTools::simulateSites., 'rates' and 'states' must have the same length.");
75 vector<const Site*> vs(numberOfSites);
76 for (
size_t i = 0; i < numberOfSites; i++)
78 Site* s = simulator.simulateSite(states[i], rates[i]);
79 s->setPosition(static_cast<int>(i));
82 SiteContainer* sites =
new VectorSiteContainer(vs, simulator.getAlphabet());
83 sites->setSequencesNames(simulator.getSequencesNames(),
false);
85 for (
size_t i = 0; i < numberOfSites; i++)
96 size_t numberOfSites = states.size();
97 vector<const Site*> vs(numberOfSites);
98 for (
size_t i = 0; i < numberOfSites; i++)
100 Site* s = simulator.simulateSite(states[i]);
101 s->setPosition(static_cast<int>(i));
104 SiteContainer* sites =
new VectorSiteContainer(vs, simulator.getAlphabet());
105 sites->setSequencesNames(simulator.getSequencesNames(),
false);
107 for (
size_t i = 0; i < numberOfSites; i++)
The SiteSimulator interface. SiteSimulator classes can simulate single sites.
virtual Site * simulateSite() const =0
virtual const Alphabet * getAlphabet() const =0
virtual std::vector< std::string > getSequencesNames() const =0