谁能告诉我应该如何解决这个问题?我在将多个应用程序附加到一个代理时遇到问题。(我在 Ubuntu12.10 上运行 ns2.35)
我的环境中有两个节点(源和目标),这里有一些功能:
我在目标节点上附加了一个丢失监控代理。
我在源节点上附加了一个 udp 代理。
我通过以下声明在 udp 代理上附加了 9 个应用程序:
set nExpGen 9 for {set i 1} {$i <= $nExpGen} {incr i} { set eee($i) [new Application/Traffic/Exponential] $eee($i) attach-agent $udp $ns connect $eee($i) $lmt #nExpGen= number of exponential generators #eee = exponential application #lmt = loss-monitor agent
运行我的 tcl 文件时出现错误“无法读取代理地址:没有这样的变量..”(请参阅 [错误消息])
我是否使用错误的方式将这些应用程序附加到代理?我该如何解决?
谢谢大家。
[错误信息]
can't read "agent_addr_": no such variable
while executing
"subst $[subst $var]"
(procedure "_o40" line 5)
(Object next line 5)
invoked from within
"_o40 next agent_addr_"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o40" line 11)
(Application/Traffic set line 11)
invoked from within
"$dst set agent_addr_"
(procedure "_o3" line 2)
(Simulator simplex-connect line 2)
invoked from within
"$self simplex-connect $dst $src"
(procedure "_o3" line 10)
(Simulator connect line 10)
invoked from within
"$ns connect $eee($i) $lmt"
("for" body line 4)
invoked from within
"for {set i 1} {$i <= $nExpGen} {incr i} {
set eee($i) [new Application/Traffic/Exponential]
$eee($i) attach-agent $udp
$ns con..."
(file "myTest3.tcl" line 47)