use of dr.app.beauti.types.OperatorType in project beast-mcmc by beast-dev.
the class TipDateSamplingComponentOptions method selectOperators.
public void selectOperators(final ModelOptions modelOptions, final List<Operator> ops) {
if (tipDateSamplingType == TipDateSamplingType.SAMPLE_INDIVIDUALLY || tipDateSamplingType == TipDateSamplingType.SAMPLE_PRECISION) {
TaxonList taxa = getTaxonSet();
String description = "Random walk for the age of this tip";
// OperatorType type = OperatorType.RANDOM_WALK_ABSORBING;
OperatorType type = OperatorType.UNIFORM;
if (tipDateSamplingType == TipDateSamplingType.SAMPLE_PRECISION) {
description = "Uniform sample from precision of age of this tip";
// type = OperatorType.UNIFORM;
}
for (int i = 0; i < taxa.getTaxonCount(); i++) {
Taxon taxon = taxa.getTaxon(i);
Operator operator = tipDateOperators.get(taxon);
if (operator == null) {
Parameter parameter = getTipDateParameter(taxon);
// operator = new Operator("age(" + taxon.getId() + ")", "", parameter, OperatorType.SCALE, 0.75, 1.0);
operator = new Operator.Builder("age(" + taxon.getId() + ")", description, parameter, type, 1.0, 1.0).build();
if (tipDateSamplingType == TipDateSamplingType.SAMPLE_INDIVIDUALLY) {
operator.setWeight(2.0);
}
tipDateOperators.put(taxon, operator);
}
ops.add(operator);
}
} else if (tipDateSamplingType == TipDateSamplingType.SAMPLE_JOINT) {
ops.add(modelOptions.getOperator("treeModel.tipDates"));
}
}
Aggregations