leach-c.tcl

来自「无线传感器网络中,LEACH路由协议在NS-2仿真环境的下实现的源代码」· TCL 代码 · 共 34 行

TCL
34
字号
############################################################################## This code was developed as part of the MIT uAMPS project. (June, 2000)#############################################################################source $env(uAMPS_LIBRARY)/ns-leach.tclsource $env(uAMPS_LIBRARY)/ns-leach-c.tclset opt(rcapp)        "LEACH/LEACH-C"     ;# Application typeset opt(tr)           "/tmp/leach-c.tr"   ;# Trace file# Need to spread the data by k+1set opt(spreading)    [expr $opt(num_clusters)+1]set outf [open "$opt(dirname)/conditions.txt" w]puts $outf "\nUSING LEACH-C: CENTRALIZED CLUSTER FORMATION\n"close $outfsource mit/uAMPS/sims/uamps.tcl# Parameters for centralized control cluster formation algorithmset opt(adv_info_time)    [TxTime [expr $opt(hdr_size) + 12]]set opt(finish_adv)       [expr $opt(nn_) * $opt(adv_info_time)]set opt(bs_setup_iters)   1000            ;# Num iters for sim. annealing alg.set opt(bs_setup_max_eps) 10              ;# Max change for sim. annealing alg.set outf [open "$opt(dirname)/conditions.txt" a]puts $outf "Desired number of clusters = $opt(num_clusters)"puts $outf "Spreading factor = $opt(spreading)"puts $outf "Changing clusters every $opt(ch_change) seconds\n"close $outf

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?