/** * Add a node to the tree. * * @param DecisionTree_Node $node */ function addNode(DecisionTree_Node $node) { $id = $node->getId(); if (isset($this->nodes[$id])) { throw new Exception("Node with id " . $node->id() . " is already part of the tree."); } $node->_bind($this); $this->nodes[$id] = $node; }