for (Node node : net.getNodes()) {
// only add if it is not redundant
if (returnedNet.getNodeIndex(node.getName()) < 0) {
// supposedly, we only need the marginals, so we don't have to copy the structure of the net nor its details
returnedNet.addNode(node);
}
}
}
}