Search on the Internet to add the module of the tutorial, found a post: http://blog.csdn.net/barcodegun/article/details/6898193, but this post just gives how to add the steps, I think the writing is relatively simple, We don't know what to do when we need to add other modules. Therefore, I write this post, will be many of the details of the problems and reasons to show.
Vanet-highway, this module is Bradley DuPont on the basis of Arbabi, Weigle to improve the module code, the use of XML files and added more scene factors, see the relevant documents, code documents and introduction documents can be in Google Code down: https://code.google.com/p/ns-3-highway-mobility/downloads/list, some students can not turn the wall to download, I upload a copy to CSDN:/http download.csdn.net/detail/zy416548283/7626425, this code comes from Google's NS3 forum: https://groups.google.com/forum/#!msg/ns-3-users/ AOXI5A9TCY8/3-WLCEX31J4J, the code in Google code is more consistent with the module's folder classification.
Sub-module compilation, you can refer to this post: http://zzgthk.iteye.com/blog/1402271, with a simple example, teach you how to add modules. NS3 's official also has a tutorial, in Ns3-manual, ns3.20 is in section 18.2: Adding a New Module to ns-3. Specifically not translated, very good reference, there is a Python file can help you to generate modules related files and directories:
./create-module.py New-module
Vanet-highway is given an example, in order to run this example, after adding a good module (create a new file directly, and then copy the compressed file into it), and then need to use a WAF to compile the module, in the process of compiling the module, due to the NS3 version of the continuous upgrade, The usage of ns3.15 and the use of ns3.20 have produced some changes, and now the compilation process of some of the problems (compiled using./waf), according to the question of succession, to make a record for reference:
1.(. text+0x18): A reference to ' main ' undefined, this is when I add the test module myself, the main function is misspelled, and it is possible that the file has not been saved.
2.Buildcontext ' object has no attribute ' New_task_gen ', compare the file, you know the new version of the WScript of the wording has changed. The following changes can be done:
#headers = Bld.new_task_gen (features=[' ns3header ') headers = bld (features= ' Ns3header ')
3... /src/vanet-highway/model/wificonfigurationxml.h:50:36:error: ' wifi_phy_standard_80211p_cch ' is not declared in this Scope
using google search, searched for this file: http://www.nsnam.org/~pdbarnes/doxygen/wifi-phy-standard_8h _source.html, add these two variables in the file.
4.". /src/vanet-highway/model/highway.cc:255:85:error: ' min ' is not declared in this scope
View this file, MATH.H does not have this function, use the Fmin function instead of this function.
5../src/vanet-highway/model/highway.cc:83:28:error:expected type-specifier Before ' list '
Put a std::list in front of the list.
6. How the program works, you can read the example program yourself, see also: https://code.google.com/p/ns-3-highway-mobility/ Wiki/highwaymobilityandvehicularnetworksinns3#how_to_run
7. Generated file vehicletrace.csv and networktrace.csv, specific meaning, can also be viewed in the wiki;
The rest is to analyze the code, and try to use the Netanim to draw the vehicle's motion trajectory. Google Code also provides a vehicle viewer code that you can try to use next.