本文整理匯總了Java中dr.inference.operators.SimpleMCMCOperator類的典型用法代碼示例。如果您正苦於以下問題:Java SimpleMCMCOperator類的具體用法?Java SimpleMCMCOperator怎麽用?Java SimpleMCMCOperator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SimpleMCMCOperator類屬於dr.inference.operators包,在下文中一共展示了SimpleMCMCOperator類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseXMLObject
import dr.inference.operators.SimpleMCMCOperator; //導入依賴的package包/類
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final double weight = xo.getDoubleAttribute(WEIGHT);
JointGibbsOperator operator = new JointGibbsOperator(weight);
for (int i = 0; i < xo.getChildCount(); i++) {
if (xo.getChild(i) instanceof GibbsOperator)
operator.addOperator((SimpleMCMCOperator) xo.getChild(i));
else
throw new RuntimeException("Operator list must consist only of GibbsOperators");
}
return operator;
}
示例2: parseXMLObject
import dr.inference.operators.SimpleMCMCOperator; //導入依賴的package包/類
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
for (int i = 0; i < xo.getChildCount(); ++i) {
SimpleMCMCOperator operator = (SimpleMCMCOperator) xo.getChild(i);
operator.doOperation();
}
return null;
}
示例3: parseXMLObject
import dr.inference.operators.SimpleMCMCOperator; //導入依賴的package包/類
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final double weight = xo.getDoubleAttribute(WEIGHT);
final double targetProb = xo.getAttribute(TARGET_ACCEPTANCE, 0.2);
if (targetProb <= 0.0 || targetProb >= 1.0)
throw new RuntimeException("Target acceptance probability must be between 0.0 and 1.0");
JointOperator operator = new JointOperator(weight, targetProb);
for (int i = 0; i < xo.getChildCount(); i++) {
operator.addOperator((SimpleMCMCOperator) xo.getChild(i));
}
return operator;
}
示例4: getSyntaxRules
import dr.inference.operators.SimpleMCMCOperator; //導入依賴的package包/類
@Override
public XMLSyntaxRule[] getSyntaxRules() {
return new XMLSyntaxRule[]{
new ElementRule(SimpleMCMCOperator.class, 1, Integer.MAX_VALUE),
};
}