📄 main.tcl
字号:
source "init.tcl"# Exclusion of useless packet headersremove-packet-header AODV aSRM CtrMcast Diffusion Encap\ HttpInval IMEP IPinIP IVS LDP mcastCtrl MFTP MPLS\ MIP Ping PGM PGM_SPM PGM_NAK RAP RTP Resv rtProtoDV rtProtoLS SR Src_rt SRM SRMEXT\ Snoop TCPA TFRC TFRC_ACK TORA GAF UMP Pushback NVset ns_ [new Simulator]$ns_ use-scheduler Heap ;# The scheduler uses a heap structurens-random seed 717source "param.tcl"set tracefd [open "$opt(dir)$opt(idx).tr" w]set topo [new Topography]$ns_ set-address-format hierarchical ;# Wired-cum-wireless scenarios need hierarchical routing$ns_ node-config -addressType hierarchical$ns_ trace-all $tracefd$ns_ set RouterTrace "OFF"$ns_ set AgentTrace_ "OFF"$ns_ set MacTrace_ "OFF"$topo load_flatgrid $opt(x) $opt(y) ;# Defines the size of the topographycreate-god [expr $opt(nn) + $opt(bs)] ;# The God object creates a matrix to store connectivity informationsource "topology.tcl"source "motion.tcl"source "traffic.tcl"source "script.tcl"source "finish.tcl"$ns_ at [expr $opt(stop) + 10.0] "finish"$ns_ at [expr $opt(stop) + 11.0] "puts \"NS EXITING...\" ; $ns_ halt"save_parproc stampa_tempo {} { global ns_ puts "tempo : [$ns_ now]" $ns_ at [expr [$ns_ now] + 1.0] "stampa_tempo"}$ns_ at 0.0 "stampa_tempo"puts "Starting Simulation..."$ns_ run ;# The simulation starts...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -