NS2:能量模型以及新版Trace格式仿真結果(.tr文件)中各數據的含義

一、能量模型:

$ns_ node-config

       -adhocRouting $opt(adhocRouting) \
        ......
       -energyModel  $opt(energy)\      #EnergyModel
       -txPower $opt(txpower)\
       -rxPower $opt(rxpower)\
       -initialEnergy $opt(initialenergy)\
       -idlePower $opt(idlepower)\
       -channel $chan_1_


二、仿真得到的數據如下(rmac.tr):


1、上半段仿真數據解釋:

        N  -t  8.000000    -n   2   -e   9999.803096

(1)、N  -t : Simulation_time

(2)、-n  2 : node id is 2

(3)、-e  9999.905600 : remaining energy level

2、下半段仿真數據解釋:

       [energy  9999.801278     ei  0.078     es  0.000     et  0.032     er  0.089]

(1)、energy: total remaining energy

(2)、ei: energy consumption in IDLE state

(3)、es: energy consumption in SLEEP state

(4)、et: energy consumed in transmitting packets

(5)、er: energy consumed in receiving packets


三、trace新格式(alohamac.tr):

$ns  use-newtrace       #使用新trace格式時,需要添加此句代碼
set   tracefd [open $opt(tr) w]
set   nf  [open $opt(nam) w]

$ns  trace-all  $tracefd
$ns  namtrace-all-wireless $nf  $opt(x)  $opt(y)

新格式數據如下:








發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章