public class RandomDirection extends MovementModel
Random Direction movement model as described in: Elizabeth M. Royer, P. Michael Melliar-Smith, and Louise E. Moser, "An Analysis of the Optimum Node Density for Ad hoc Mobile Networks"
Nodes will start at a random place on the simulation area and pick a random direction and follow it to the edge of the simulation area. They will then pause and pick another direction to go in until they hit the edge again.
comBus, DEF_SPEEDS, DEF_WAIT_TIMES, host, maxSpeed, maxWaitTime, minSpeed, minWaitTime, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE| Constructor and Description |
|---|
RandomDirection(RandomDirection other) |
RandomDirection(Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
Coord |
getInitialLocation()
Returns a new initial placement for a node
|
Path |
getPath()
Returns a new path by this movement model or null if no new path could
be constructed at the moment (node should wait where it is).
|
protected double |
getTravelFraction()
Returns the fraction of the path to follow towards the edge.
|
MovementModel |
replicate()
Creates a replicate of the movement model.
|
generateSpeed, generateWaitTime, getComBus, getHost, getMaxX, getMaxY, isActive, nextPathAvailable, reset, setComBus, setHost, toStringpublic RandomDirection(Settings settings)
public RandomDirection(RandomDirection other)
public Path getPath()
MovementModelgetPath in class MovementModelpublic Coord getInitialLocation()
MovementModelgetInitialLocation in class MovementModelpublic MovementModel replicate()
MovementModelreplicate in class MovementModelprotected double getTravelFraction()
1.0 causes the node to
travel all the way to the edge, returning 0.5 would cause the
node to travel half way, etc.