which Module to use in my code?

25 views
Skip to first unread message

Faiza Firdousi

unread,
Oct 30, 2017, 4:19:06 AM10/30/17
to ns-3-users
Can anyone please help me to figure out which modules to include in the script that I want to write?? Where is the list of all modules? and how to know which one is the one that is required? 

For example I want to us the class Time. Class Time is included in which module?
like we use the :

  #include "ns3/core-module.h"
  #include "ns3/simulator-module.h"
  #include "ns3/node-module.h"
  #include "ns3/helper-module.h"

Also I want to declare a variable : 
Time t=Simulator::Now(); in the model file Aodv-routing-protocol.cc. 
How should I use or call this variable 't' in my main program? 
Basically I want to catch a time 't' and then Schedule an event 
at that time in my main program which is in the scratch folder. 
Also tell me which header files I would have to include in order to 
do that? I suppose   #include "ns3/aodv-routing-protocol.h"  and 
#include "ns3/nstime.h"?? 
Please forgive me if its a silly question. :( But I'm new at this 
and am really stuck between some errors and I think they are because
of the header files being not included properly. 

Konstantinos

unread,
Oct 30, 2017, 6:09:06 AM10/30/17
to ns-3-users
Hi,

These names/modules are more than 10yr old. The structure of ns-3 has changed some time around ns-3.9.
The list of ns-3 modules are the list of folders in src, more details in the API https://www.nsnam.org/docs/doxygen/modules.html

Regards
K

Faiza Firdousi

unread,
Oct 30, 2017, 12:01:28 PM10/30/17
to ns-3-...@googlegroups.com
Dear Konstantinos,

Thanks for your quick response. If you can, please take some time to also answer my second question aswell, please. What if I want to use a variable:
Time t=Simulator::Now(); , then how would I use/call it in my main program in the scratch directory? 

Thanks in advance.
Regards.

--
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 a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/2_A0odYRxDw/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Konstantinos

unread,
Oct 30, 2017, 1:25:03 PM10/30/17
to ns-3-users
Hi,

That's basic C++ programming.
The API for that class/method also reports which header file you should include. The 'module' headers are simply aggregation of all (in principle) of the header files of that module so that you do not need to include several files. If you know in which module they belong (i.e. which folder they are in source) you simply include that header.

Follow the tutorial and examples to get a better feeling on the code.

Regards
K
Reply all
Reply to author
Forward
0 new messages