public void testEdgesCountingReseting() {
GraphViewImpl view = dhnsGlobal2.getGraphStructure().getMainView();
graphGlobal2Directed.resetViewToLeaves();
assertEquals(2, view.getMutualEdgesEnabled());
assertEquals(10, view.getEdgesCountEnabled());
LevelIterator lvlIterator = new LevelIterator(view.getStructure(), 2, Tautology.instance);
for (; lvlIterator.hasNext();) {
AbstractNode node = lvlIterator.next();
assertEquals(node.getEdgesInTree().getCount(), node.getEnabledInDegree());
assertEquals(node.getEdgesOutTree().getCount(), node.getEnabledOutDegree());
int expectedMutual = 0;
ParamAVLIterator<AbstractEdge> edgeIterator = new ParamAVLIterator<AbstractEdge>();
for (edgeIterator.setNode(node.getEdgesOutTree()); edgeIterator.hasNext();) {
AbstractEdge edge = edgeIterator.next();
AbstractNode target = edge.getTarget(view.getViewId());
if (node != target && target.getEdgesOutTree().hasNeighbour(node)) {
expectedMutual++;
}
}
assertEquals(expectedMutual, node.getEnabledMutualDegree());
}
graphGlobal2Directed.resetViewToTopNodes();
assertEquals(0, view.getMutualEdgesEnabled());
assertEquals(0, view.getEdgesCountEnabled());
graphGlobal2Directed.resetViewToLevel(1);
assertEquals(2, view.getMutualEdgesEnabled());
assertEquals(10, view.getEdgesCountEnabled());
LevelIterator lvlIterator2 = new LevelIterator(view.getStructure(), 2, Tautology.instance);
for (; lvlIterator2.hasNext();) {
AbstractNode node = lvlIterator2.next();
assertEquals(node.getEdgesInTree().getCount(), node.getEnabledInDegree());
assertEquals(node.getEdgesOutTree().getCount(), node.getEnabledOutDegree());
int expectedMutual = 0;
ParamAVLIterator<AbstractEdge> edgeIterator = new ParamAVLIterator<AbstractEdge>();
for (edgeIterator.setNode(node.getEdgesOutTree()); edgeIterator.hasNext();) {