akeranen / the-one

The Opportunistic Network Environment simulator
Other
208 stars 198 forks source link

Update DTNHost.java #76

Closed ewertonsalvador closed 5 years ago

ewertonsalvador commented 5 years ago

In the current implementation there is a bug that appears when someone uses a movement trace file with ExternalMovement: at some point the positions of the nodes won't match the positions provided in the trace file. This behavior starts to happen when the destination property is not null and the method setNextWaypoint (line 396) returns false (meaning no more waypoints are available). In this situation, the next time the DTNHost.move method is called there will be no update to the node's next waypoint, since the destination property is different than null, preventing the simulator to run the method setNextWaypoint (line 384). The consequence of this is the occurrence of wrong values for the destination and speed properties, resulting in the simulator calculating incorrect positions for the node.

akeranen commented 5 years ago

Thanks @ewertonsalvador! I think you are correct with this, but I'm having a bit hard time replicating the bug. Could you perhaps extend the ExternalMovementTest to catch this bug?

ewertonsalvador commented 5 years ago

Sure thing @akeranen ! I will create a new pull request with an extension to ExternalMovementTest.