[ns] getting the position of node

2011-07-17 Thread Zilu LIANG

Hi everyone.
I'm running simulation in an area of 1200m*1200m.
I use the following code to get the position of the node a and c:

MobileNode *a, *c;

a = (MobileNode *)(Node::get_node_by_address(index));
c = (MobileNode *)(Node::get_node_by_address(next));

a-update_position();
xa = a-X();
ya = a-Y();

c-update_position();
xc = c-X();
yc = c-Y();

//Then I calculate the distance between node a and c
AC = sqrt((xa-xc)*(xa-xc)+(ya-yc)*(ya-yc));

I think there is no problem with the above codes, but when i print out the
position of a,c and the distance AC, they are as follows:

ax=212254207 ay=1083267180 cx=-814812632 cy=1083132008
AC=-1073577898

This is obviously not correct, but I do not know where is the problem.
Does anyone has any idea on it?

Thanks in advance!

Cheers,
Zilu


[ns] Using SVM in Ns-2

2011-06-18 Thread Zilu LIANG

Hello everyone!
I'm thinking of using SVM in NS-2, any idea how to do it?

Thanks in advance. Cheers!
Zilu


[ns] Scenario generation in NS-2

2011-05-13 Thread Zilu LIANG

Hello guys,

Does any one knows how to generate scenarios in which the initial positions
of the nodes are the same, only the moving speed is different? Any comment
is welcomed!

Thanks in advance!

Cheers!

Pandita