NetAnim - nodes not found in location table

274 views
Skip to first unread message

Brandon

unread,
Sep 20, 2017, 5:28:04 AM9/20/17
to ns-3-users
Hello,

I have just installed the ns-3 highway mobility module from https://github.com/weiglemc/ns-3-highway-mobility/. I have changed some things to make it work with the latest version of ns-3, and everything seems to run just fine.

However, I cannot seem to get NetAnim to work. The error I get is as follows:

"Node:0 not found in Location table"


All nodes in the simulation are contained withing the Vehicle class, and are assigned a mobility model inside the class' constructor.

Vehicle::Vehicle() {
    m_node = CreateObject<Node > ();
    MobilityHelper mobility;
    mobility.Install(m_node);
    .....

Soon after the Vehicle's creation, the node position is also set:

m_node->GetObject<MobilityModel > ()->SetPosition(value);

I would assume that having set the position in the following manner would be enough to get the node into NetAnim's location table, so I am really confused by the error message.

Inside the main function, I have placed the AnimationInterface anim ("animation.xml"); line just above Simulator::Run(); as seems to be the norm.

Does anyone have an idea what I might be doing wrong?

Many Thanks,
Brandon

Konstantinos

unread,
Sep 20, 2017, 6:04:29 AM9/20/17
to ns-3-users
Hi,

I haven't used the highway code, but from a quick look it of the example, it seems like the mobility models etc are getting installed at runtime (t=0) - look at how it is initialized.
This may be the cause of the issue with NetAnim. 

Regards
K

Brandon

unread,
Sep 20, 2017, 6:27:55 AM9/20/17
to ns-3-users
Hi Konstantinos,

You are correct. No vehicles are created before the simulation is run. They are added at random intervals after the start of the simulation (number of vehicles and intervals are different every run and specified in an external XML file).

Does NetAnim not support nodes being created at runtime?

Thanks,
Brandon

John Abraham

unread,
Sep 22, 2017, 5:51:50 PM9/22/17
to ns-3-...@googlegroups.com
No, creating nodes at run-time is not supported.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages