我用的是NS-2.35 .我修改了AODV协议,以支持受控的移动性。我需要将x和y位置(在执行移动性算法之后)从C++传递到TCL,然后将它们放入(setdest)命令中。我在aodv构造函数中做了以下操作:
bind("x_axis",&x_tcl);
bind("y_axis",&y_tcl);
我在ns-default.tcl.中给出了x_axis和y轴的默认值。
我就是这样在TCL代码中使用它们的:
$ns at 21.0 "$node_(0) setdest $x_axis $y_axis 100.0"
但我得到了以下错误:
num_nodes is set 36
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
can't read "x_axis": no such variable
while executing
"$ns at 21.0 "$node_(0) setdest $x_axis $y_axis 100.0""
(file "eaodv.tcl" line 309)
有什么问题吗?你能帮帮我吗?
发布于 2017-04-06 06:42:12
我认为问题在于您在tcl中使用绑定变量。
$ns at 21.0 "$node_(0) setdest x_axis y_axis 100.0"这应该对OTcl链接有帮助
https://stackoverflow.com/questions/29715083
复制相似问题