use of dr.inference.markovchain.MarkovChainListener in project beast-mcmc by beast-dev.
the class MCMC method init.
/**
* Must be called before calling chain.
*
* @param options the options for this MCMC analysis
* @param schedule operator schedule to be used in chain.
* @param likelihood the likelihood for this MCMC
* @param loggers an array of loggers to record output of this MCMC run
*/
public void init(MCMCOptions options, Likelihood likelihood, OperatorSchedule schedule, Logger[] loggers) {
MCMCCriterion criterion = new MCMCCriterion();
criterion.setTemperature(options.getTemperature());
mc = new MarkovChain(likelihood, schedule, criterion, options.getFullEvaluationCount(), options.minOperatorCountForFullEvaluation(), options.getEvaluationTestThreshold(), options.useCoercion());
this.options = options;
this.loggers = loggers;
this.schedule = schedule;
//initialize transients
currentState = 0;
if (Factory.INSTANCE != null) {
for (MarkovChainListener listener : Factory.INSTANCE.getStateSaverChainListeners()) {
mc.addMarkovChainListener(listener);
}
}
}
Aggregations