jist.swans.field
Class Mobility.Teleport

java.lang.Object
  extended by jist.swans.field.Mobility.Teleport
All Implemented Interfaces:
Mobility
Enclosing interface:
Mobility

public static class Mobility.Teleport
extends java.lang.Object
implements Mobility

Teleport mobility model: pick a random location and teleport to it, then pause for some time and repeat.

Since:
SWANS1.0
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.field.Mobility
Mobility.MobilityInfo, Mobility.RandomWalk, Mobility.RandomWaypoint, Mobility.RandomWaypointInfo, Mobility.Static, Mobility.Teleport
 
Field Summary
private  Location.Location2D bounds
          Movement boundaries.
private  long pauseTime
          Waypoint pause time.
 
Constructor Summary
Mobility.Teleport(Location.Location2D bounds, long pauseTime)
          Initialize teleport mobility model.
 
Method Summary
 Mobility.MobilityInfo init(FieldInterface f, java.lang.Integer id, Location loc)
          Initiate mobility; initialize mobility data structures.
 void next(FieldInterface f, java.lang.Integer id, Location loc, Mobility.MobilityInfo info)
          Schedule next movement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

private Location.Location2D bounds
Movement boundaries.


pauseTime

private long pauseTime
Waypoint pause time.

Constructor Detail

Mobility.Teleport

public Mobility.Teleport(Location.Location2D bounds,
                         long pauseTime)
Initialize teleport mobility model.

Parameters:
bounds - boundaries of movement
pauseTime - waypoint pause time (in ticks)
Method Detail

init

public Mobility.MobilityInfo init(FieldInterface f,
                                  java.lang.Integer id,
                                  Location loc)
Initiate mobility; initialize mobility data structures.

Specified by:
init in interface Mobility
Parameters:
f - field entity
id - node identifier
loc - node location
Returns:
mobility information object

next

public void next(FieldInterface f,
                 java.lang.Integer id,
                 Location loc,
                 Mobility.MobilityInfo info)
Schedule next movement. This method will again be called after every movement on the field.

Specified by:
next in interface Mobility
Parameters:
f - field entity
id - radio identifier
loc - destination of move
info - mobility information object