private void addThreshold(Node node, double weight) { //add a threshod input to a node Node thresh = new Node(node.getLayer(), node.getPos(), true); thresh.setOutput(-1); Connection cn = new Connection(thresh, node, weight); thresh.addOutputConnection(cn); node.addInputConnection(cn); }