Search in sources :

Example 1 with RLTVLogger

use of dr.evomodel.tree.randomlocalmodel.RLTVLogger in project beast-mcmc by beast-dev.

the class RLTVLoggerParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    RandomLocalTreeVariable randomLocal = (RandomLocalTreeVariable) xo.getChild(RandomLocalTreeVariable.class);
    String fileName = xo.getStringAttribute(FILENAME);
    int logEvery = xo.getIntegerAttribute(LOG_EVERY);
    TabDelimitedFormatter formatter = null;
    try {
        formatter = new TabDelimitedFormatter(new PrintWriter(new FileWriter(fileName)));
    } catch (IOException e) {
        e.printStackTrace();
    }
    return new RLTVLogger(formatter, logEvery, treeModel, randomLocal);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) RLTVLogger(dr.evomodel.tree.randomlocalmodel.RLTVLogger) FileWriter(java.io.FileWriter) TabDelimitedFormatter(dr.inference.loggers.TabDelimitedFormatter) IOException(java.io.IOException) RandomLocalTreeVariable(dr.evomodel.tree.randomlocalmodel.RandomLocalTreeVariable) PrintWriter(java.io.PrintWriter)

Aggregations

TreeModel (dr.evomodel.tree.TreeModel)1 RLTVLogger (dr.evomodel.tree.randomlocalmodel.RLTVLogger)1 RandomLocalTreeVariable (dr.evomodel.tree.randomlocalmodel.RandomLocalTreeVariable)1 TabDelimitedFormatter (dr.inference.loggers.TabDelimitedFormatter)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1