[英]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 =“属性名称= NextWaypoint tid = ns3 :: WaypointMobilityModel:不能使用属性设置初始值”
您尝试使用的属性无效。 如果您阅读类参考,则NextWaypoint和WaypointsLeft仅适用于“ READ”。 您无法设置它们,这就是为什么您得到“无法使用属性设置初始值”的原因。
/src/mobility/test/waypoint-mobility-model-test.cc中有WaypointMobilityModel的参考方案(测试用例)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.