在NS3提供的演示样例first.py中,并没有生成NetAnim所须要的xml文件,本节我们尝试用NetAnim来展示first.py的仿真结果。
按照NetAnim的说明,在Run開始前加上一行:
anim = ns.netanim.AnimationInterface('first.xml') ns.core.Simulator.Run() ns.core.Simulator.Destroy()
再次执行这个脚本。能够发如今我们的项目文件所在的文件夹下生成了first.xml,在NetAnim中打开它: