1
我实际上需要知道我的TCL脚本中UDP代理的属性(打印一些值并将其用于统计),这是我第一次使用这种脚本语言。我试图使用命令info,但我没有使用它。在NS2中获取代理的属性
这是我的代码:
puts [info class variables udp] #Fail (same error)
puts [info class variables $udp] #Error : _o87 does not refer to an object
没有更多的结果:
#Setup a UDP connection
set udp [new Agent/UDP]
puts [$udp info class] # Work and print "Agent/UDP"
puts [info class variables Agent/UDP] #Fail with the error "Agent/UDP does not refer to an object"
我试过了。 你能告诉我我做错了什么以及如何获取我的Agent/UDP对象的属性。
FWIW,我写TclOO是对Tcl的主要对象系统。它具有XOTcl的语义和incrTcl的语法,除了语法和语义无法融合的地方。它还引发了其他一些事情,使整个系统更快速,更加Tcl-ish。 –
此外,我链接到上面的文档文件是旧的。像19岁那样。 NS-2是OTcl的_only_用户,我知道... –