for (BNNode node : bNNodes) {
if (node.isNature() || node.isDecision()) {
ClusterBundle cbundle = clusterHash.get(node);
SJTVertex jtcluster = cbundle.jtcluster;
FMarginalizationMap mfmap = cbundle.mfmap;
PT marginal = new PT(mfmap.getProjectionDomainProduct());
PT.marginalizeDomainsFast(marginal,
jtcluster.getPotential().getProbabilityPotential(),
mfmap);
node.setMarginal(marginal);
} else if (node.isUtility()) {
ClusterBundle cbundle = clusterHash.get(node);
SJTVertex jtcluster = cbundle.jtcluster;
PT utility = jtcluster.getPotential().getProbabilityPotential().clone();
utility.multiplyBySubtable(node.getDiscreteCPT(), cbundle.fopmap);
node.setMarginalUtility(utility.sum());
}
}
}