首页 > 解决方案 > 在 NS3 中执行 Randomwalk2dmobility 时发生错误

问题描述

我是NS3的新手。我想了解 Randomwalk2d 模块中切换的执行状态并可视化。默认是两个Ue和两个enb,但是执行过程中总会出错。谁能帮我解决问题?
这是我的代码链接:https
://drive.google.com/file/d/163NQOyvs0bTh2J4P9_vpS4Y7iqocB3HJ/view?usp=sharing 当我执行命令时:./waf --run scratch/lte_handover --visualize,出现以下错误

../scratch/lte_handover.cc:In funtion 'int main(int, char**)':
../scratch/lte_handover.cc:296:78: error: expected ')' before ';' token
"Bounds",RectangleValue (Rectangle (0,2000,0,2000)));
^
Build failed
->task in 'lte_handover' failed with exit status 1 (运行 -v 显示更多信息)
按照说明输入命令 : ./waf --run scratch/lte_handover -v,出现以下信息

标签: ns-3

解决方案


似乎您)在上面的那一行中有一个额外的。您没有在评论所有行时关闭此命令

ueMobility.SetPositionAllocator ("ns3::RandomRectanglePositionAllocator",  // <-- close
ueMobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel","Bounds", RectangleValue (Rectangle (0,2000,0,2000)));

推荐阅读