在NS3中添加新的VANET模块
本文主要参考http://blog.csdn.net/barcodegun/article/details/6898193此博主的学习笔记,但由于版本过老,很多小细节不适用于ns-3.26,特来更新自己的学习笔记。
在NS3中添加新的VANET模块(vanet-test)
1. $cd ~/ns-allinone-3.26/ns-3.26/src
$./create-module.py vanet-test
即生成如下结构:
src/new-module/doc/new-module.rstexamples/new-module-example.ccwscripthelper/new-module-helper.ccnew-module-helper.hmodel/new-module.ccnew-module.htest/new-module-test-suite.ccwscript
*摘自ns3-manual
2. 原文中说需要需改的src/vanet/wscript及之后的内容需要改变,可能是因为版本的不一样。
修改方法:
src/vanet-test/wscript内容如下:
def build(bld):
module = bld.create_ns3_module('vanet-test', ['network','propagation','wifi','mobility','core'])
module.source = [
'model/controller.cc',
'model/highway.cc',
'model/lane-change.cc',
'model/model.cc',
'model/obstacle.cc',
'model/vehicle.cc',
]
module_test = bld.create_ns3_module_test_library('vanet-test')
module_test.source = [
'test/vanet-test-test-suite.cc',
]
headers = bld(features='ns3header')
headers.module = 'vanet-test'
headers.source = [
'model/controller.h',
'model/highway.h',
'model/lane-change.h',
'model/model.h',
'model/obstacle.h',
'model/vehicle.h',
]
if bld.env.ENABLE_EXAMPLES:
bld.recurse('examples')
# bld.ns3_python_bindings()
src/vanet/examples/wscript内容如下:
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('vanet-highway-test',
['core', 'mobility', 'network', 'wifi', 'vanet'])
obj.source = 'vanet-highway-test.cc'
src/vane-testt/test/examples-to-run.py此处依旧按照原文操作。
注:将原文件夹中各模块内的.cc .h文件复制进对应的文件内。(eg. modul内的controller.cc等复制进/vanet-test/modul)因为版本问题controller.cc等无法编译。
3. $cd ..
$cd .. //回到ns-3.26
$./waf clean
$./waf configure --enable-examples --enable-tests
$./waf build
4. 编译后
Modules built:
antenna aodv applications
bridge buildings config-store
core csma csma-layout
dsdv dsr energy
fd-net-device flow-monitor internet
internet-apps lr-wpan lte
mesh mobility mpi
netanim (no Python) network nix-vector-routing
olsr point-to-point point-to-point-layout
propagation sixlowpan spectrum
stats tap-bridge test (no Python)
topology-read traffic-control uan
vanet-test (no Python) virtual-net-device visualizer
wave wifi wimax
在NS3中添加新的VANET模块相关推荐
- Android 驱动(17)---如何在linux中添加新的kernel module
如何在linux中添加新的kernel module 该SOP针对客户如何添加一个kernel module,并把生成的.ko打包进system.img的过程. 解决方案 L版本(version> ...
- Android内核开发:在源码树中添加新的app应用
本文是<Android内核开发>系列的第十二篇文章,上一篇文章介绍了如何从源码中删除出厂的app应用,本文则在此基础上,详细介绍一下如何在Android内核源码树中添加一个新的app应用. ...
- Android4.0中添加新语言实现方案(以缅甸语为例)
查看了网上的一些 关于Android2.3实现的添加新的语言的方案.我没有验证过但发现在4.0中不适用 不适用的原因 是: Android4.0中关于 icu4c模块(处理语言国际化模块)是通过dat ...
- 在VirtualBox中的Ubuntu中添加新硬盘
2019独角兽企业重金招聘Python工程师标准>>> 在VirtualBox中的Ubuntu中添加新硬盘 VitrualBox是不允许更改重置硬盘大小的,所以当硬盘不足时,只能添加 ...
- Sharepoint学习笔记—Ribbon系列-- 5. 在Ribbon中添加新控件(针对用户自定义Tab)
前面我们实现了向用户自定义的Tab中添加新的Group,并向其中创建了两个Button按钮.这里我们看看如何向这个已经创建好的Group中再另外添加新的Button控件(当然,你可以添加其它控件,实现 ...
- linux 添加新的系统调用,如何在Linux中添加新的系统调用
如何在Linux中添加新的系统调用 2010-01-29 eNet&Ciweek #define __NR_mycall 191 系统调用号为191,之所以系统调用号是191,是因为Linux ...
- 修改Visual Studio中“添加新项”时默认添加的命名空间
最近要修改一个以前开发的项目,项目中并没有运用Linq,但是我在VS2008中添加新项都会自动添加Linq命名空间,每次都要手动去删除很麻烦,就想想有没有办法可以修改这个"添加新项" ...
- MySQL中添加新字段
© Ptw-cwl 要在MySQL中添加新字段,您可以使用ALTER TABLE语句. 以下是添加新字段的基本语法: ALTER TABLE table_name ADD column_name da ...
- js 对象中添加新属性
js 对象中添加新属性 对象数组添加新属性 同名属性会被覆盖,相同属性会去重
最新文章
- Windows环境下启动Mysql服务提示“1067 进程意外终止”的解决方案
- e300氛围灯哪里调节_奥迪Q5L安装原厂32色20灯源氛围灯
- 第一行代码学习笔记第二章——探究活动
- DSP关于存储器读写、IO读写时序图的注意点
- 2018-2019-1 20165303 实验五 通讯协议设计
- cut最后几位 shell_shell命令_cut
- java打印unicode_java程序实现Unicode码和中文互相转换
- 网游Server端开发基础
- html5 字段换行,关于换行以及换行属性
- 为什么要使用Memcached
- Java培训哪个机构比较好?怎么选?
- Ubuntu设置开机自启动
- c++标准扩展TR1
- 和刘备相关的人(四)
- shor 量子算法,合数分解
- 短线操盘的10种方法、
- getaddrinfo神秘面纱
- git bash here将本地代码更新到远程仓库
- 初级入门华为交换机学习
- 三国佚事——巴蜀之危 全送错信件问题