use of beast.util.XMLParser in project beast2 by CompEvol.
the class TestFramework method analyse.
// protected abstract void analyse() throws Exception;
public void analyse(int index_XML) throws Exception {
// for (int i = 0; i < xmls.length; i++) {
// if (giveExpectations(i).size() > 0) {
Randomizer.setSeed(SEED);
Logger.FILE_MODE = Logger.LogFileMode.overwrite;
long beagleFlags = BeagleFlag.PROCESSOR_CPU.getMask() | BeagleFlag.VECTOR_SSE.getMask();
System.setProperty("beagle.preferred.flags", Long.toString(beagleFlags));
String fileName = dirName + xmls[index_XML];
System.out.println("Processing " + fileName);
XMLParser parser = new XMLParser();
beast.core.Runnable runable = parser.parseFile(new File(fileName));
runable.setStateFile("tmp.state", false);
// runable.setInputValue("preBurnin", 0);
// runable.setInputValue("chainLength", 1000);
runable.run();
String logFile = logDir + testFile + (useSeed ? SEED : "") + ".log";
System.out.println("\nAnalysing log " + logFile);
// burnIn = 0.1 * maxState
LogAnalyser logAnalyser = new LogAnalyser(logFile, giveExpectations(index_XML));
for (Expectation expectation : logAnalyser.m_pExpectations.get()) {
Assert.assertTrue(xmls[index_XML] + ": Expected " + expectation.traceName.get() + " delta mean: " + expectation.expValue.get() + " - " + expectation.getTraceStatistics().getMean() + " <= delta stdErr: 2*(" + expectation.getStdError() + " + " + expectation.getTraceStatistics().getStdErrorOfMean() + ")", expectation.isPassed());
if (checkESS)
Assert.assertTrue(xmls[index_XML] + ": has very low effective sample sizes (ESS) " + expectation.getTraceStatistics().getESS(), expectation.isValid());
}
System.out.println("\nSucceed " + fileName);
System.out.println("\n***************************************\n");
// }
// }
}
Aggregations