movement
Class RandomWaypoint

java.lang.Object
  extended by movement.MovementModel
      extended by movement.RandomWaypoint

public class RandomWaypoint
extends MovementModel

Random waypoint movement model. Creates zig-zag paths within the simulation area.


Field Summary
 
Fields inherited from class movement.MovementModel
DEF_SPEEDS, DEF_WAIT_TIMES, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE
 
Constructor Summary
RandomWaypoint(Settings settings)
           
 
Method Summary
 Coord getInitialLocation()
          Returns a possible (random) placement for a host
 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).
 RandomWaypoint replicate()
          Creates a replicate of the movement model.
 
Methods inherited from class movement.MovementModel
generateSpeed, generateWaitTime, getMaxX, getMaxY, isActive, nextPathAvailable, reset, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomWaypoint

public RandomWaypoint(Settings settings)
Method Detail

getInitialLocation

public Coord getInitialLocation()
Returns a possible (random) placement for a host

Specified by:
getInitialLocation in class MovementModel
Returns:
Random position on the map

getPath

public Path getPath()
Description copied from class: MovementModel
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). A new path should not be requested before the destination of the previous path has been reached.

Specified by:
getPath in class MovementModel
Returns:
A new path or null

replicate

public RandomWaypoint replicate()
Description copied from class: MovementModel
Creates a replicate of the movement model.

Specified by:
replicate in class MovementModel
Returns:
A new movement model with the same settings as this model