movement
Class ShortestPathMapBasedMovement

java.lang.Object
  extended by movement.MovementModel
      extended by movement.MapBasedMovement
          extended by movement.ShortestPathMapBasedMovement
All Implemented Interfaces:
SwitchableMovement

public class ShortestPathMapBasedMovement
extends MapBasedMovement
implements SwitchableMovement

Map based movement model that uses Dijkstra's algorithm to find shortest paths between two random map nodes and Points Of Interest


Field Summary
 
Fields inherited from class movement.MapBasedMovement
backAllowed, FILE_S, lastMapNode, MAP_BASE_MOVEMENT_NS, MAP_SELECT_S, maxPathLength, minPathLength, NROF_FILES_S
 
Fields inherited from class movement.MovementModel
DEF_SPEEDS, DEF_WAIT_TIMES, maxSpeed, maxWaitTime, minSpeed, minWaitTime, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE
 
Constructor Summary
  ShortestPathMapBasedMovement(Settings settings)
          Creates a new movement model based on a Settings object's settings.
protected ShortestPathMapBasedMovement(ShortestPathMapBasedMovement mbm)
          Copyconstructor.
 
Method Summary
 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).
 ShortestPathMapBasedMovement replicate()
          Creates a replicate of the movement model.
 
Methods inherited from class movement.MapBasedMovement
getInitialLocation, getLastLocation, getMap, getOkMapNodeTypes, isReady, selectRandomOkNode, setLocation
 
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
 
Methods inherited from interface movement.SwitchableMovement
getLastLocation, isReady, setLocation
 

Constructor Detail

ShortestPathMapBasedMovement

public ShortestPathMapBasedMovement(Settings settings)
Creates a new movement model based on a Settings object's settings.

Parameters:
settings - The Settings object where the settings are read from

ShortestPathMapBasedMovement

protected ShortestPathMapBasedMovement(ShortestPathMapBasedMovement mbm)
Copyconstructor.

Parameters:
mbm - The ShortestPathMapBasedMovement prototype to base the new object to
Method Detail

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.

Overrides:
getPath in class MapBasedMovement
Returns:
A new path or null

replicate

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

Overrides:
replicate in class MapBasedMovement
Returns:
A new movement model with the same settings as this model