首页 >> 大全

ns3gym与ns3ai的安装方法

2023-11-16 大全 30 作者:考证青年

编译运行的常用命令

1,针对ns3主项目的编译命令

分两步:第一,./waf ;第二,./waf(或者./waf build)

详见《开源网络模拟器ns3》P13

2,针对多脚本同时运行的编译命令

ns3-ai的相关笔记

安装方法

基本要求:一定要检查系统的版本是否是或以上,否则无法安装ns3-ai的-。ns3-ai适配的ns3版本为ns-3.30(务必使用ns-3.30),应先在系统下(以 16.04为例)成功安装并编译好ns-3.30后再进行下列操作步骤。

参考资料:

1,ns3-ai文献:Yin H, Liu P, Liu K, et al. ns3-ai: for [C]// of the 2020 on ns-3. 2020: 57-64.

2,ns3-ai在NS3 App Store上的网页介绍(推荐使用,结合下面的详细安装步骤即可)

ns-3 App Store - ns3-ai

3,ns3-ai在上的开源代码网页(也可成功安装)

- hust-/ns3-ai: the ns-3 and using , which mean you can train and test your AI in ns-3 any you are using now!

详细安装步骤:

1,将网上下载的源码(推荐使用“参考资料2”中的源码)解压后再添加到ns-3.30中的目录下,并重新命名为ns3-ai

2,重新编译ns-3.30

./waf

./waf

3,Add

3.1,( is used and )

cd $//ns3-ai/

setup.py --user

步骤3.1完成后,则安装完毕

3.2,Baisc usage(此处应该是介绍 的用途,以下代码在安装步骤中不需要执行)

.Init(1234, 4096) # key

v = (233, c_int*10)

with v as o:

for i in range(10):

o[i] = c_int(i)

print(*o)

.()

4,测试是否成功安装

RL-TCP (ns3和ai是在两个终端窗口上运行的)

4.1,Run ns-3 (终端窗口1):

cp -r contrib/ns3-ai/example/rl-tcp scratch/
./waf --run "rl-tcp"

4.2,Run code(终端窗口2):

cd contrib/ns3-ai/example/rl-tcp/
python testtcp.py

NOTE: the RL test in is not fully , soon.

问题:目前在4.2步骤中运行命令后无反应,问题待解决(可查阅相关issue中的问答记录)

ns3-gym的相关笔记

安装方法

基本要求:ns3-gym适配的ns3版本为ns-3.29(务必使用ns-3.29),ns3-gym官网上示意.04为例进行介绍安装步骤的(不排除可兼容更高版本的系统)。应先在系统下成功安装并编译好ns-3.29后再进行下列操作步骤。

参考资料:

1,ns3-gym文献:Gawłowicz P, Zubow A. Ns-3 meets gym: The for in [C]// of the 22nd ACM on , and of and . 2019: 113-120.

2,ns3-gym在NS3 App Store上的网页介绍(推荐使用,结合下面的详细安装步骤即可)

ns-3 App Store - ns3-gym: Gym

3,ns3-gym在上的开源代码网页(编译时会出现ZMQ报错,可查阅上的 寻找解决方法)

- tkn-tub/ns3-gym: ns3-gym - The for in

详细安装步骤:

1, from the

the (推荐使用“参考资料2”中的源码) and it:

tar -xzf ns3-gym-1.0.0.tar.gz

Move (and ) the ns3-gym-1.0.0 to(将解压后的文件重命名为,并放置到目录内):

ns-3.29//

注:放置到src目录内也可以安装成功

2, ZMQ and libs:

Note: to -3.6 on 16.04, run:

sudo add-apt- ppa:-/

sudo apt-get

Then:

_安装方法英文_安装方法可以归纳为

sudo apt-get -dev -y

sudo apt-get -dev -y

sudo apt-get - -y

3, and build ns-3 :

Note: if you use , these it.

Note: (C++ and ) are build .

./waf ---

./waf build

(成功运行上述命令后,可以看到控制台输出的 built列表中包含了)

4, .

Note: is .

4.1, (not if ./waf was ):

(如果第3步中使用./waf 命令编译,未加上---,则无需进行4.1步骤)

cd ./ns-3.29///

-I=./model/ --=./model// ./model/.proto

4.2, :

pip3 ./ns-3.29///model/

(官网上使用了pip,可在不同机器上尝试pip或pip3)

5,测试是否成功安装

5.1,测试用例1

cp -r .//// /

cd .//

./.py

5.2,测试用例2

# 1

cp -r /ns3-gym// /

./waf --run ""

# 2

cd .//

./test.py --start=0

关于我们

最火推荐

小编推荐

联系我们


版权声明:本站内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 88@qq.com 举报,一经查实,本站将立刻删除。备案号:桂ICP备2021009421号
Powered By Z-BlogPHP.
复制成功
微信号:
我知道了