本文介绍了无效的命令名称“Agent/LeachAgent"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为 LEACH 协议实现一个简单的场景,但出现此错误:

I try to implement a simple scenario for LEACH protocol but I get this error:

 Creating Sensors ...
    invalid command name "Agent/LeachAgent"
        while executing
    "Agent/LeachAgent create _o2340 "
        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 Agent/LeachAgent"
        ("for" body line 3)
        invoked from within
    "for {set i 1} {$i <= $val(nsn)} {incr i} {

        set agent($i) [new Agent/LeachAgent]
        $ns attach-agent $node_($i) $agent($i)
        $agent($i) set packetSize_..."
        (file "newleach3.tcl" line 187)

我使用 ubuntu 16.04ns-allinone-2.35 .当我第一次运行 tcl 文件时,我没有收到这个错误.

I use ubuntu 16.04 and ns-allinone-2.35 . when I ran my tcl file for the first time, i did not get this error.

推荐答案

我没有成功编写正确的代码来在我的场景中附加 Leach 协议,但我发现 mannasim 有一个 Mannasim 脚本生成器 (MSG).TCL 仿真脚本的前端,易于创建.

I was not successful in writing a correct code for attaching Leach protocol in my scenario, but I found that mannasim has a Mannasim Script Generator (MSG). It is a front-end for TCL simulation scripts easy creation.

这篇关于无效的命令名称“Agent/LeachAgent"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-20 13:26