NS2
Kchaw Amira <[email protected]> Tue, 23 Apr 2019 22:18:42 +0100
| Newsgroups | gmane.network.simulator.isi |
|---|---|
| Message-ID | <CAJgSHiu1tvoAF1hBWcZirmmQGi82e80Zr7Sbt_w4Ox7e5347zQ@mail.gmail.com> |
--000000000000e486330587392178 Content-Type: text/plain; charset="UTF-8" Hello, I extract the position and speed of vehicles using this code: fprintf(fp,"Node , Position is X, Y, Z, Speed \n"); t_node=(MobileNode*)(Node::get_node_by_address(index)); ((MobileNode*) t_node)->getLoc(&xpos,&ypos,&zpos); fprintf(fp,"%d %f %f %f",index,xpos,ypos,zpos); t_node=(MobileNode*)(Node::get_node_by_address(index)); n_speed=((MobileNode*)t_node)->speed(); fprintf(fp,"%d %d \n",index,n_speed); and put it in an external file. But, in this external file does not appear all the vehicles of the network. for example: my network consists of 5 vehicles but the external file shows only 4 vehicles and sometimes (3 vehicles). Can someone tell me why all vehicles do not appear in the external file and help me fix this problem? Is it dependent on the range transmission of each vehicle? Can somebody help me please. Thank you in advance. --000000000000e486330587392178 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div>Hello,</div><div><br></div><div>I=C2= =A0 extract the position and speed of vehicles using this code:=C2=A0</div>= <div><br></div><div><div>fprintf(fp,"Node , Position is X, Y, Z, Speed= \n");</div><div>t_node=3D(MobileNode*)(Node::get_node_by_address(inde= x));</div><div>((MobileNode*) t_node)->getLoc(&xpos,&ypos,&z= pos);</div><div>fprintf(fp,"%d %f %f %f",index,xpos,ypos,zpos);</= div><div>t_node=3D(MobileNode*)(Node::get_node_by_address(index));</div><di= v>n_speed=3D((MobileNode*)t_node)->speed();</div><div>fprintf(fp,"%= d %d \n",index,n_speed);</div></div><div><br></div><div>and put it in = an external file.</div><div>But, in this external file does not appear all = the vehicles of the network.</div><div>for example: my network consists of = 5 vehicles but the external file shows only 4 vehicles and sometimes (3 veh= icles).</div><div>Can someone tell me why all vehicles do not appear in the= external file and help me fix this problem?</div><div>Is it dependent on t= he range transmission of each vehicle?</div><div><div>Can somebody help me = please.=C2=A0</div><div><br></div><div>Thank you in advance.</div></div><di= v><br></div></div></div> --000000000000e486330587392178--