motion.tcl

来自「R. Lo Cigno, P. Larcheri 802.11e closed」· TCL 代码 · 共 22 行

TCL
22
字号
set bsx [expr $opt(x) / 2.0]       ;# Position of the Base Stationset bsy [expr $opt(y) / 2.0]$BS(0) set X_ $bsx$BS(0) set Y_ $bsyset pi 3.1415926535897932384626433832795029puts $file(finish) "#\n#\tNode's Initial Positions :\n#"puts $file(finish) [format "#\t\t%15s    x:%6.3f    y:%6.3f" "Base Station" $bsx $bsy]# The following cycle sets the position of the wireless stations. They lie on a circumference#   with diameter 'opt(dia)', while the Base Station is in the centerforeach j [lessof $opt(nn)] {        set posx [expr $bsx + [expr $opt(dia) * cos([expr 2.0 * $pi * $j / $opt(nn)]) / 2]]        set posy [expr $bsy + [expr $opt(dia) * sin([expr 2.0 * $pi * $j / $opt(nn)]) / 2]]        $node_($j) set X_ $posx        $node_($j) set Y_ $posy        puts $file(finish) [format "#\t\t%15s    x:%6.3f    y:%6.3f" "Node $j" $posx $posy]}

⌨️ 快捷键说明

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