[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Incorrect wireless node placement in nam



Nam incorrectly places the last defined node in a network of wireless
nodes at 0,0. The following nam file exercises the bug:

W -t * -x 20 -y 50
n -t * -s 1  -x 15 -y 30 -Z 0 -z 20  -v circle -c black
n -t * -s 2  -x 15 -y 30 -Z 0 -z 20  -v circle -c black
n -t * -s 3  -x 15 -y 30 -Z 0 -z 20  -v circle -c black
n -t * -s 4  -x 15 -y 30 -Z 0 -z 20  -v circle -c black

When run thru nam the last defined node (node 4) is placed both lower 
and to the left of the other nodes instead of on top of all the other
nodes.

I am using the 7 august 2000 snapshot.

I think the problem is in the function NetModel::placeEverything()
in the file netmodel.cc. Changing line 2195 in file netmodel.cc from:

	if (nodes_)

to

	if (nodes_ && !wireless_)

fixes the problem. The validation tests for non wireless networks
run as before. The validation tests for wireless networks fail,
probably because the node placement is now correct and the "right"
test result may have used the incorrect node placement.

I have no idea of the result for networks of mixed wireless and wired
nodes.

-- 
John Judge
Senior Research Engineer                 Email: [email protected]
Scalable Commodity Internet Laboratory          Ph: +61 2 9666 0669
Motorola Australian Research Centre            Fax: +61 2 9666 0501