正在ns3中添加路点
Adding waypoints in ns3
我是ns3的新手,这就是我一直在做的事情。我试图添加路点,但不知道怎么做,如果你们能帮助,那就太好了
这就是我尝试的:
mobility.SetMobilityModel ("ns3::WaypointMobilityModel",
"NextWaypoint", WaypointValue(),
"WaypointsLeft", UintegerValue (1),
"LazyNotify", BooleanValue (false),
"InitialPositionIsWaypoint", BooleanValue (false)
);
mobility.Install (wifiStaNodes); //wifiStanodes is my nodeContainer
Ptr<WaypointMobilityModel> waypoints =wifiStaNodes.Get(0)->GetObject<WaypointMobilityModel> ();
waypoints->AddWaypoint (Waypoint (Seconds (0.0), Vector (0.0, 0.0, 0.0)));
waypoints->AddWaypoint (Waypoint (Seconds (2.0), Vector (50.0, 50.0, 0)));
但这似乎不起作用,而且还有一个错误:
msg="属性name=NextWaypoint tid=ns3::WaypointMobilityModel:不能使用属性设置初始值"
航路点移动模型类别参考
您尝试使用的属性无效。如果您阅读了类引用,NextWaypoint和WaypointsLeft仅用于"read"。您不能设置它们,这就是为什么您得到"初始值不能使用属性设置"。
/src/mobility/test/waypoint-mobility-model-test.cc 中有WaypointMobilityModel的参考场景(测试用例)
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 如何在C++中从两个单独的for循环中添加两个数组
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 如何仅为一个函数添加延迟
- 数到第n个楼梯的路(顺序无关紧要)
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- 使用std::transform将一个范围的元素添加到另一个范围中
- 如何将更多文件夹添加到c++include路径
- 如何将元素添加到数组的线程安全函数?
- QT通过C++添加映射QML项目
- vscode g++链路故障:体系结构x86_64的未定义符号
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么Mat类的两个对象可以在不重载运算符+的情况下添加
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 只能向C++添加一定数量的字符
- Qt和C++:将QLineEdit添加到QTabWidget中
- 如何添加到 2 路链表的第一个
- 正在ns3中添加路点
- 在ns3中的两个节点之间创建无线链路