movement
Class ExternalMovement

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

public class ExternalMovement
extends MovementModel

Movement model that uses external data of node locations.


Field Summary
static java.lang.String EXTERNAL_MOVEMENT_NS
          Namespace for settings
static java.lang.String MOVEMENT_FILE_S
          external locations file's path -setting id ("file")
static java.lang.String NROF_PRELOAD_S
          number of preloaded intervals per preload run -setting id ("nrofPreload")
 
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
ExternalMovement(Settings settings)
          Constructor for the prototype.
 
Method Summary
 Coord getInitialLocation()
          Returns a new initial placement for a node
 int getMaxX()
          Returns the largest X coordinate value this model uses
 int getMaxY()
          Returns the largest Y coordinate value this model uses
 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).
 boolean isActive()
          Returns true if this node is active at the moment (false if not)
 double nextPathAvailable()
          Returns a sim time when the next path is available.
 MovementModel replicate()
          Creates a replicate of the movement model.
static void reset()
          Reset state so that next instance will have a fresh state
 
Methods inherited from class movement.MovementModel
generateSpeed, generateWaitTime, getComBus, setComBus, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXTERNAL_MOVEMENT_NS

public static final java.lang.String EXTERNAL_MOVEMENT_NS
Namespace for settings

See Also:
Constant Field Values

MOVEMENT_FILE_S

public static final java.lang.String MOVEMENT_FILE_S
external locations file's path -setting id ("file")

See Also:
Constant Field Values

NROF_PRELOAD_S

public static final java.lang.String NROF_PRELOAD_S
number of preloaded intervals per preload run -setting id ("nrofPreload")

See Also:
Constant Field Values
Constructor Detail

ExternalMovement

public ExternalMovement(Settings settings)
Constructor for the prototype. Run once per group.

Parameters:
settings - Where settings are read from
Method Detail

getInitialLocation

public Coord getInitialLocation()
Description copied from class: MovementModel
Returns a new initial placement for a node

Specified by:
getInitialLocation in class MovementModel
Returns:
The initial coordinates for a node

isActive

public boolean isActive()
Description copied from class: MovementModel
Returns true if this node is active at the moment (false if not)

Overrides:
isActive in class MovementModel
Returns:
true if this node is active (false if not)

nextPathAvailable

public double nextPathAvailable()
Returns a sim time when the next path is available.

Overrides:
nextPathAvailable in class MovementModel
Returns:
The sim time when node should ask the next time for a path

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

getMaxX

public int getMaxX()
Description copied from class: MovementModel
Returns the largest X coordinate value this model uses

Overrides:
getMaxX in class MovementModel
Returns:
Maximum of X coordinate values

getMaxY

public int getMaxY()
Description copied from class: MovementModel
Returns the largest Y coordinate value this model uses

Overrides:
getMaxY in class MovementModel
Returns:
Maximum of Y coordinate values

replicate

public MovementModel 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

reset

public static void reset()
Reset state so that next instance will have a fresh state