2012年3月5日
摘要: NSG2.1.jar在网上可以下到,不过运行它需要安装JRE。我们可以利用NSG2.1生成一些平时经常使用的网络场景。打开命令:$java -jar NSG2.1.jar打开之后在屏幕左上方有一个小方块,可以随意拉成比较大的场景图,设置自己的网络参数等等,最后生成NS2可以运行的tcl脚本。 阅读全文
posted @ 2012-03-05 18:02 Fuzzy Joke 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 1.tcl脚本传入一个int变量给c++代码 在command解析里 int nodenum=atoi(argv[2]); printf("%d",nodenum); 2.在nam中输出结果 Tcl::instance().evalf("$ns trace-annotate \"node send d_\""); 3.改变node颜色$node1 color red 4.注册顶级命令 即tcl脚本写init_topology class InitTopologyCommand : public TclCommand { public: 阅读全文
posted @ 2012-03-05 17:59 Fuzzy Joke 阅读(1650) 评论(0) 推荐(0) 编辑
摘要: ns2中仿真之后的.tr文件中以下是我无线网络仿真之后的.tr文件中一部分s 0.500000000 _0_AGT --- 0 cbr 210 [0 0 0 0] ------- [0:0 1:0 320] [0] 0 0r 0.500000000 _0_RTR --- 0 cbr 210 [0 0 0 0] ------- [0:0 1:0 320] [0] 0 0s 0.500000000 _0_RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:25530 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)s 0.50053500 阅读全文
posted @ 2012-03-05 17:58 Fuzzy Joke 阅读(2432) 评论(0) 推荐(0) 编辑
摘要: 一、基础篇:在linux命令提示符下运行gnuplot命令启动,输入quit或q或exit退出。 1、plot命令 gnuplot> plot sin(x) with line linetype 3 linewidth 2 或 gnuplot> plot sin(x) w l lt 3 lw 2 %用线画,线的类型(包括颜色与虚线的类型)是3,线的宽度是2,对函数sin(x)作图 gnuplot> plot sin(x) with point pointtype 3 pointsize 2 或 gnuplot> plot sin(x) w p pt 3 ps 2 %用点 阅读全文
posted @ 2012-03-05 17:57 Fuzzy Joke 阅读(915) 评论(0) 推荐(0) 编辑