⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leach-c.tcl

📁 Matlab下的大名鼎鼎的Leach分簇算法实现。对网络研究的有用处
💻 TCL
字号:
############################################################################## 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -