ns3 netanim 可视化

ns3 版本 3.36.1

编写脚本

  	...
#include "ns3/netanim-module.h"
  	...
int main(){
    
    
  	...
  	AnimationInterface anim("xxx.xml"); //生成的xml文件的名字
  	Simulator::Run ();
  	Simulator::Destroy ();
  	return 0;
}

执行脚本

~/ns3/ns-allinone-3.36.1/ns-3.36.1 $ ./ns3 run scratch/myfirst.cc

用NetAnim 打开xml文件

~/ns3/ns-allinone-3.36.1/netanim-3.108 $ ./NetAnim

打开NetAnim后打开生成的xml文件,就可以看见自己创建的节点了

猜你喜欢

转载自blog.csdn.net/qq_51952286/article/details/125588203
今日推荐