S.Shenbegavalli
S.Shenbegavalli

Reputation: 41

Stop movement of a node in one simulator

How to stop movement of a particular node in One Simulator? Speed settings are found in default_settings.txt .But how to change the speed of a node dynamically?

Upvotes: 0

Views: 323

Answers (2)

Mr.Li
Mr.Li

Reputation: 16

In this case, you can also use the other movement module in movement folder. Most of them are map-based movement, if you can provide corresponding map-based data, you can achieve "move for some time and stop thereafter".

Meanwhile, writing your own movement module is an alternative method and it can be more effective in most cases. In ONE simulator, you need to know that the location of each node is updated in moveHosts(double timeIncrement) function in World.java. To realize your own movement logic, you need to rewrite move() function in DTNHost.java. A new movement module (e.g., MoveAndStop.java) which inherit MovementModel class in MovementModel.java and changes about Group.MovementModel=MoveAndStop.java in default_settings.txt are also required.

Note that if you want to realize your own movement logic according to the current simulation time, you can call SimClock.getTime() function to get it.

I hope my answer can inspire you to solve your problem.

Upvotes: 0

Mr.Li
Mr.Li

Reputation: 16

In movement folder, there exist "StationaryMovement" module, which can make a particular node stay in a particular location.

Setting in "default_settings.txt": To enable this module, at first, you need to create this particular node as a single Group (e.g., Group1) . Then, you need to change "movementModel" setting of this group as "StationaryMovement".

For example:

Group1.groupID = S
Group1.nrofHosts = 1
Group1.movementModel = StationaryMovement
Group1.nodeLocation = [X,Y]
...
...

Upvotes: 0

Related Questions