if (m_bNeedsUndoAction) {
addUndoAction(new AddValueAction(nTargetNode, sNewValue));
}
Attribute att = m_Instances.attribute(nTargetNode);
int nCardinality = att.numValues();
FastVector values = new FastVector(nCardinality);
for (int iValue = 0; iValue < nCardinality; iValue++) {
values.addElement(att.value(iValue));
}
values.addElement(sNewValue);
replaceAtt(nTargetNode, att.name(), values);
// update distributions of this node
Estimator[] distributions = m_Distributions[nTargetNode];
int nNewCard = values.size();
for (int iParent = 0; iParent < distributions.length; iParent++) {
DiscreteEstimatorBayes distribution = new DiscreteEstimatorBayes(nNewCard, 0);
for (int iValue = 0; iValue < nNewCard - 1; iValue++) {
distribution.addValue(iValue, distributions[iParent].getProbability(iValue));
}