运行aomdv模拟代码时出现ns2错误

时间:2013-03-06 18:53:50

标签: c++ tcl ns2

我尝试在ns-2.34 / tcl / ex / wpan目录中运行demo tcl文件。我将协议更改为AOMDV。我收到以下错误。

       (_o14 cmd line 1)
        invoked from within
    "_o14 cmd addr"
        invoked from within
    "catch "$self cmd $args" ret"
        invoked from within
    "if [catch "$self cmd $args" ret] {
    set cls [$self info class]
    global errorInfo
    set savedInfo $errorInfo
    error "error when calling class $cls: $args" $..."
        (procedure "_o14" line 2)
        (SplitObject unknown line 2)
        invoked from within
    "_o14 addr"
        ("eval" body line 1)
        invoked from within
    "eval $node addr $args"
        ("default" arm line 2)
        invoked from within
    "switch -exact $routingAgent_ {
    DSDV {
    set ragent [$self create-dsdv-agent $node]
    }
    DSR {
    $self at 0.0 "$node start-dsr"
    }
    AODV {
    set ragent [$self cre..."
        (procedure "_o3" line 11)
        (Simulator create-wireless-node line 11)
        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 node_($i) [$ns_ node]   
        $node_($i) random-motion 0      ;# disable random motion`enter code here`
    }"
        (file "wpan_demo1.tcl" line 109)

当我选择AOMDV作为协议时,为什么程序运行AODV。

1 个答案:

答案 0 :(得分:0)

必须为协议设置Instproc。否则ns无法找到新协议。