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

📄 ns-diffusion.tcl

📁 R. Lo Cigno, P. Larcheri 802.11e closed-loop scheduling Description: ns-2 package for 802.11e clo
💻 TCL
字号:
# All diffusion related procedures go hereSimulator instproc add-gear { node } {    set gear [new Application/DiffApp/GeoRoutingFilter]    $self attach-diffapp $node $gear    $self at 0.01 "$gear start"}Simulator instproc attach-diffapp { node diffapp } {    $diffapp dr [$node get-dr]}Node instproc get-dr {} {    $self instvar diffAppAgent_    if [info exists diffAppAgent_] {	return $diffAppAgent_    } else {	puts "Error: No DiffusionApp agent created for this node!\n" 	exit 1    }}Node instproc create-diffusionApp-agent {} {    $self instvar gradient_ diffAppAgent_        # first we create diffusion agent    # if it doesnot exist already    # then we start the gradient filter    if [info exists diffAppAgent_] {	puts "diffAppAgent_ exists: $diffAppAgent_"	return $diffAppAgent_    }    #puts "creating new DiffAppAgent_"    $self set diffAppAgent_ [new Agent/DiffusionApp]    set da $diffAppAgent_    set port [get-da-port $da $self]    $da agent-id $port    $da node $self        set gradient_ [new Application/GradientFilter $da]     #$gradient_ debug 10        return $da}proc get-da-port {da node} {    # diffusion assumes diffusion-application agent    # to be attached to non-zero port numbers    # thus for assigning port 254 to diffAppAgent    set port [Node set DIFFUSION_APP_PORT]    $node attach $da $port    return $port}

⌨️ 快捷键说明

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