public void reset(BNetwork network){
  if (System.identityHashCode(this) != System.identityHashCode(network)) {
    nodes.clear();
    chanceNodes.clear();
    utilityNodes.clear();
    actionNodes.clear();
    for (    BNode node : network.getNodes()) {
      addNode(node);
    }
  }
}

public void reset ( BNetwork network ) { if ( System . identityHashCode ( this ) != System . identityHashCode ( network ) ) { nodes . clear ( ) ; chanceNodes . clear ( ) ; utilityNodes . clear ( ) ; actionNodes . clear ( ) ; for ( BNode node : network . getNodes ( ) ) { addNode ( node ) ; } } }
resets the bayesian network to only contain the nodes contained in the argument . everything else is erased .
