Search in sources :

Example 1 with RandomBranchAssignmentModel

use of dr.evomodel.branchmodel.RandomBranchAssignmentModel in project beast-mcmc by beast-dev.

the class RandomBranchAssignmentModelParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    Logger.getLogger("dr.evomodel").info("\nUsing random assignment branch model.");
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    XMLObject cxo = xo.getChild(MODELS);
    List<SubstitutionModel> substitutionModels = new ArrayList<SubstitutionModel>();
    for (int i = 0; i < cxo.getChildCount(); i++) {
        SubstitutionModel substModel = (SubstitutionModel) cxo.getChild(i);
        substitutionModels.add(substModel);
    }
    return new RandomBranchAssignmentModel(treeModel, substitutionModels);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) ArrayList(java.util.ArrayList) XMLObject(dr.xml.XMLObject) RandomBranchAssignmentModel(dr.evomodel.branchmodel.RandomBranchAssignmentModel) SubstitutionModel(dr.evomodel.substmodel.SubstitutionModel)

Aggregations

RandomBranchAssignmentModel (dr.evomodel.branchmodel.RandomBranchAssignmentModel)1 SubstitutionModel (dr.evomodel.substmodel.SubstitutionModel)1 TreeModel (dr.evomodel.tree.TreeModel)1 XMLObject (dr.xml.XMLObject)1 ArrayList (java.util.ArrayList)1