/** Updates the value for this node. Called by <code>step()</code>. */ @Override public double update(N v) { if (!cumulative) { return super.update(v); } collectDisappearingPotential(v); double v_input = 0; for (N u : graph.predecessors(v)) { for (E e : graph.edgesConnecting(u, v)) { v_input += (getCurrentValue(u) * getEdgeWeight(u, e).doubleValue()); } } // modify total_input according to alpha double new_value = alpha > 0 ? v_input * (1 - alpha) + getNodePrior(v) * alpha : v_input; setOutputValue(v, new_value + getCurrentValue(v)); // FIXME: DO WE NEED TO CHANGE HOW DISAPPEARING IS COUNTED? NORMALIZE? return Math.abs(getCurrentValue(v) - new_value); } }
public double update(V v) { if (!cumulative) { return super.update(v);
return super.update(v);
return super.update(v);