movement
Class RandomWaypoint

java.lang.Object
  extended by movement.MovementModel
      extended by movement.RandomWaypoint
Direct Known Subclasses:
ClusterMovement

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
comBus, DEF_SPEEDS, DEF_WAIT_TIMES, maxSpeed, maxWaitTime, minSpeed, minWaitTime, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE
 
Constructor Summary
protected RandomWaypoint(RandomWaypoint rwp)
           
  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).
protected  Coord randomCoord()
           
 RandomWaypoint replicate()
          Creates a replicate of the movement model.
 
Methods inherited from class movement.MovementModel
generateSpeed, generateWaitTime, getComBus, getMaxX, getMaxY, isActive, nextPathAvailable, reset, setComBus, 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)

RandomWaypoint

protected RandomWaypoint(RandomWaypoint rwp)
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

randomCoord

protected Coord randomCoord()