微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 ns2 中引入新的队列命令?

如何解决如何在 ns2 中引入新的队列命令?

这不是 how to implement multiple queues in Ns-2 的副本。

  • 目标 - 我想在不干扰现有队列的情况下改变队列行为的内部结构。
  • 我做了什么 - 所以我复制了 Queue、DropTail、PriQueue 和一些其他类,这些类依赖于相应的标头、cc 文件作为 Queue1、DropTail1、...。重建 ns2 应用程序。
  • 我的 tcl 代码使用 Queue/DropTail/PriQueue 作为 ifqType,因此我将其更改为 Queue1/DropTail1/PriQueue1
  • 当我执行 ns myfile.tcl 时,它显示以下错误
num_nodes is set 10
invalid command name "Queue1/DropTail1/PriQueue1"
    while executing
"Queue1/DropTail1/PriQueue1 create _o20 "
    invoked from within
"catch "$className create $o $args" msg"
    invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__Failed_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
    (procedure "new" line 3)
    invoked from within
"new $qtype"
    (procedure "_o14" line 11)
    (Node/MobileNode add-interface line 11)
    invoked from within
"$node add-interface $chan $propInstance_ $llType_ $macType_  $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_  $inerrProc_ $outerrProc_ $FECProc_"
    (procedure "_o3" line 83)
    (Simulator create-wireless-node line 83)
    invoked from within
"_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o3" line 23)
    (Simulator node line 23)
    invoked from within
"$ns node"
    ("for" body line 2)
    invoked from within
"for {set i 0} {$i < $val(nn) } { incr i } {
        set mnode_($i) [$ns node]
}"
  • 我明白,我的更改需要反映在 C++ 代码之外的其他地方。
  1. 需要对我的代码进行哪些其他更改?
  2. 是否有允许新队列类型的分步指南?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。