java default parameter_Java Parameter.DefaultBounds方法代码示例
import dr.inference.model.Parameter; //導入方法依賴的package包/類
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
AlloppSpeciesBindings apspb = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
boolean onehyb = xo.getBooleanAttribute(ONEHYBRIDIZATION);
boolean diprootisroot = xo.getBooleanAttribute(DIPLOIDROOT_ISROOT);
final XMLObject tippopxo = xo.getChild(TIP_POPULATIONS);
final double tippopvalue = tippopxo.getAttribute(Attributable.VALUE, 1.0);
final XMLObject rootpopxo = xo.getChild(ROOT_POPULATIONS);
final double rootpopvalue = rootpopxo.getAttribute(Attributable.VALUE, 1.0);
final XMLObject hybpopxo = xo.getChild(HYBRID_POPULATIONS);
final double hybpopvalue = hybpopxo.getAttribute(Attributable.VALUE, 1.0);
AlloppSpeciesNetworkModel asnm = new AlloppSpeciesNetworkModel(apspb,
tippopvalue, rootpopvalue, hybpopvalue, onehyb, diprootisroot);
// don't know dimensionality until network created, so replace parameters
ParameterParser.replaceParameter(tippopxo, asnm.tippopvalues);
final Parameter.DefaultBounds tippopbounds =
new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.tippopvalues.getDimension());
asnm.tippopvalues.addBounds(tippopbounds);
ParameterParser.replaceParameter(rootpopxo, asnm.rootpopvalues);
final Parameter.DefaultBounds rootpopbounds =
new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.rootpopvalues.getDimension());
asnm.rootpopvalues.addBounds(rootpopbounds);
ParameterParser.replaceParameter(hybpopxo, asnm.logginghybpopvalues);
final Parameter.DefaultBounds hybpopbounds =
new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.logginghybpopvalues.getDimension());
asnm.logginghybpopvalues.addBounds(hybpopbounds);
// note hybpopvalues are different and only work for logging.
return asnm;
}
總結
以上是生活随笔為你收集整理的java default parameter_Java Parameter.DefaultBounds方法代码示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java mifare_如何正确写入Mi
- 下一篇: java的一段排序代码_Java常见排序