private DoubleFactor sumOutDependent(String nodeId,DoubleFactor factor){
  DoubleFactor sumFactor=new DoubleFactor();
  for (  Assignment a : factor.getValues()) {
    Assignment reducedA=new Assignment(a);
    reducedA.removePair(nodeId);
    double[] entry=factor.getEntry(a);
    double prob=entry[0];
    double util=entry[1];
    sumFactor.incrementEntry(reducedA,prob,prob * util);
  }
  sumFactor.normaliseUtil();
  return sumFactor;
}

private DoubleFactor sumOutDependent ( String nodeId , DoubleFactor factor ) { DoubleFactor sumFactor = new DoubleFactor ( ) ; for ( Assignment a : factor . getValues ( ) ) { Assignment reducedA = new Assignment ( a ) ; reducedA . removePair ( nodeId ) ; double [ ] entry = factor . getEntry ( a ) ; double prob = entry [ 0 ] ; double util = entry [ 1 ] ; sumFactor . incrementEntry ( reducedA , prob , prob * util ) ; } sumFactor . normaliseUtil ( ) ; return sumFactor ; }
sums out the variable from the given factor , and returns the result
