Search in sources :

Example 1 with DefaultModel

use of dr.inference.model.DefaultModel in project beast-mcmc by beast-dev.

the class DefaultModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) {
    DefaultModel likelihood = new DefaultModel();
    for (int i = 0; i < xo.getChildCount(); i++) {
        Parameter parameter = (Parameter) xo.getChild(i);
        likelihood.addVariable(parameter);
    }
    return likelihood;
}
Also used : DefaultModel(dr.inference.model.DefaultModel) Parameter(dr.inference.model.Parameter)

Example 2 with DefaultModel

use of dr.inference.model.DefaultModel in project beast-mcmc by beast-dev.

the class DummyLikelihoodParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) {
    Model model = (Model) xo.getChild(Model.class);
    Parameter parameter = (Parameter) xo.getChild(Parameter.class);
    if (model == null) {
        model = new DefaultModel();
    }
    final DummyLikelihood likelihood = new DummyLikelihood(model);
    if (parameter != null) {
        ((DefaultModel) model).addVariable(parameter);
    }
    return likelihood;
}
Also used : DefaultModel(dr.inference.model.DefaultModel) DefaultModel(dr.inference.model.DefaultModel) Model(dr.inference.model.Model) Parameter(dr.inference.model.Parameter) DummyLikelihood(dr.inference.model.DummyLikelihood)

Aggregations

DefaultModel (dr.inference.model.DefaultModel)2 Parameter (dr.inference.model.Parameter)2 DummyLikelihood (dr.inference.model.DummyLikelihood)1 Model (dr.inference.model.Model)1