|
From: <gu...@ai...> - 2006-07-28 08:28:49
|
Hi Folks,
I think I've found a bug in NetUtilities. Namely, in
randomRewireSymmetric() (albeit I think it must be present in
randomRewire(), too).
The symptoms are that after calling the method, the list of nodes returne=
d
by getOutNodes() or getInNodes() contains a few nodes that since have bee=
n
relinked. That is, the inMap/outMap maps in DefaultNode get out of sync
with the inEdges/outEdges lists.
The reason is that the rewiring method only deals with edges from one
point of view: it rewires an edge as an inEdge or outEdge, even though an
edge is _always_ both of these (at its different edges). If it wouldn't b=
e
clear, here is an excerpt from the old code and one that I think would fi=
x
the problem:
old:
jNode.removeInEdge (edge);
edge.setTo (newJNode);
newJNode.addInEdge (edge);
new:
jNode.removeInEdge (edge);
iNode.removeOutEdge(edge);
edge.setTo (newJNode);
newJNode.addInEdge (edge);
iNode.addOutEdge(edge);
I attached my version of NetUtilities.java, which only have fixes in
randomRewireSymmetric().
Best,
-- gulya
--=20
Gulyas Laszlo | Laszlo Gulyas
kut.ig. | dir. of research
AITIA Rt. | AITIA Inc.
|