use of beast.evolution.tree.coalescent.ConstantPopulation in project beast2 by CompEvol.
the class UnorderedAlignmentsTest method getTree.
public static Tree getTree(TaxonSet taxa) throws Exception {
Tree tree = new RandomTree();
TraitSet dates = getDates(taxa);
ConstantPopulation constant = new ConstantPopulation();
constant.initByName("popSize", new RealParameter("5.0"));
tree.initByName("taxonset", taxa, "populationModel", constant, "trait", dates);
return tree;
}
use of beast.evolution.tree.coalescent.ConstantPopulation in project beast2 by CompEvol.
the class StarBeastStartState method initWithMRCACalibrations.
private void initWithMRCACalibrations(List<MRCAPrior> calibrations) {
final Tree spTree = speciesTreeInput.get();
final RandomTree rnd = new RandomTree();
rnd.setInputValue("taxonset", spTree.getTaxonset());
for (final MRCAPrior cal : calibrations) {
rnd.setInputValue("constraint", cal);
}
ConstantPopulation pf = new ConstantPopulation();
pf.setInputValue("popSize", new RealParameter("1.0"));
rnd.setInputValue("populationModel", pf);
rnd.initAndValidate();
spTree.assignFromWithoutID((Tree) rnd);
final double rootHeight = spTree.getRoot().getHeight();
randomInitGeneTrees(rootHeight);
}
Aggregations