|
Bugzilla – Full Text Bug Listing |
| Summary: | WaypointMobilityModel::AddWaypoint lazy notify schedules an event using absolute time (should be relative time) | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Hossam Khader <hossamkhader> |
| Component: | mobility models | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | tomh, tommaso.pecorella |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
suggested patch
Hossam's patch + tests |
||
I agree with the fix; just would like to understand why our test did not pick this up (perhaps need to tweak the test). If all the waypoints are added at t=0, then the bug has no impact. I think that is why the bug was never picked up. In my test, I added waypoints at t>0 (In reply to Tom Henderson from comment #1) > I agree with the fix; just would like to understand why our test did not > pick this up (perhaps need to tweak the test). "tweak" is an euphemism. The test is totally not working - at all. The reason is that the testa are carried out in a "CourseChange" function, that SHOULD be called by the appropriate callback, that SHOULD be tied by this call: Config::Connect ("/NodeList/*/$ns3::WaypointMobilityModel/CourseChange", ... The problem is... in the test there's no node. DOH. I'll update the test. Created attachment 2568 [details]
Hossam's patch + tests
The patch is correct. The tests are (fortunately) working as intended.
Fortunately because before they wasn't checking anything and after fixing them they do pass.
I added a new test showing Hossam's bug and patch.
Ok with me to merge; suggest to split into two patches: Hossam's patch to fix, and separately Tommaso's fixed test case. changeset 12319:748ee83bdcec |
Created attachment 2403 [details] suggested patch WaypointMobilityModel::AddWaypoint lazy notify schedules an event using absolute time (i.e. waypoint.time) Works fine when the waypoint is added at time = 0, but if the waypoint is added at time > 0 will not work (should be waypoint.time - Simulator::Now ()) Simulator::Schedule (waypoint.time, &WaypointMobilityModel::Update, this); should be: Simulator::Schedule (waypoint.time - Simulator::Now (), &WaypointMobilityModel::Update, this);