org.mates.sim.models.mobility
Class RandomWalkingMobilityModel
java.lang.Object
org.mates.sim.models.mobility.RandomWalkingMobilityModel
- All Implemented Interfaces:
- MobilityModel
- public class RandomWalkingMobilityModel
- extends java.lang.Object
- implements MobilityModel
A mobility model that moves a host randomly. Each
moveHost()
call will first choose a new direction for
the host. This will either be straight ahead (1/3 probability),
DIRECTION_DELTA
degrees counterclockwise (1/3
probability), or DIRECTION_DELTA
degrees clockwise
(1/3 probaility). Then, the host is moved forward in its current
direction a distance of SPEED
. By default, if a host's
movement will disconnect the graph it is not moved.
Hosts using this link model must have a position of
type Position2D
.
- Author:
- Evan Sultanik
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DIRECTION_DELTA
public static double DIRECTION_DELTA
SPEED
public static double SPEED
RandomWalkingMobilityModel
public RandomWalkingMobilityModel()
- Default constructor; connectivity of the network will not be
preserved.
RandomWalkingMobilityModel
public RandomWalkingMobilityModel(boolean preserve_connectivity)
- Parameters:
preserve_connectivity
- if true
, hosts will not be moved if their movement will disconnect the network. Note that this is at a huge expense to performance.
moveHost
public void moveHost(Host host)
- Specified by:
moveHost
in interface MobilityModel
Submit a bug or request a feature
http://mates.sourceforge.net/
Copyright 2004 Evan Sultanik