report
Class MovementNs2Report

java.lang.Object
  extended by report.Report
      extended by report.MovementNs2Report
All Implemented Interfaces:
MovementListener

public class MovementNs2Report
extends Report
implements MovementListener

Movement report that generates suitable movement data for ns-2 simulator as described in http://www.isi.edu/nsnam/ns/doc/node174.html. This report ignores the warm up settings.


Field Summary
static java.lang.String COORD_FORMAT
          formatting string for coordinate values ("%.5f")
static java.lang.String DEF_NODE_ARRAY
          default value for the array name ("$node_")
static java.lang.String DEF_NS_CMD
          default value for the ns command ("$ns_")
static double EPSILON
          a value "close enough" to zero (1.0E-5).
static java.lang.String NODE_ARR_S
          node array's name -setting id ("nodeArray")
static java.lang.String NS_CMD_S
          ns command -setting id ("nsCmd")
 
Fields inherited from class report.Report
DEF_PRECISION, INTERVAL_SETTING, INTERVALLED_FORMAT, NAN, out, OUT_SUFFIX, OUTPUT_SETTING, PRECISION_SETTING, REPORT_NS, REPORTDIR_SETTING, WARMUP_S, warmupIDs, warmupTime
 
Constructor Summary
MovementNs2Report()
          Constructor.
 
Method Summary
 void initialLocation(DTNHost host, Coord location)
          Method is called when a host receives its initial location from movement model.
 void newDestination(DTNHost host, Coord dst, double speed)
          Method is called every time a host receives a new destination from its movement model.
 
Methods inherited from class report.Report
addWarmupID, done, format, getAverage, getIntAverage, getIntMedian, getMedian, getScenarioName, getSettings, getSimTime, getVariance, init, isWarmup, isWarmupID, newEvent, setPrefix, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_ARR_S

public static final java.lang.String NODE_ARR_S
node array's name -setting id ("nodeArray")

See Also:
Constant Field Values

NS_CMD_S

public static final java.lang.String NS_CMD_S
ns command -setting id ("nsCmd")

See Also:
Constant Field Values

DEF_NODE_ARRAY

public static final java.lang.String DEF_NODE_ARRAY
default value for the array name ("$node_")

See Also:
Constant Field Values

DEF_NS_CMD

public static final java.lang.String DEF_NS_CMD
default value for the ns command ("$ns_")

See Also:
Constant Field Values

EPSILON

public static final double EPSILON
a value "close enough" to zero (1.0E-5). Used for fixing zero values

See Also:
Constant Field Values

COORD_FORMAT

public static final java.lang.String COORD_FORMAT
formatting string for coordinate values ("%.5f")

See Also:
Constant Field Values
Constructor Detail

MovementNs2Report

public MovementNs2Report()
Constructor. Reads NODE_ARR_S and NS_CMD_S settings and uses those values as the name of the node array and ns command. If the values aren't present, default values of "$node_" and "$ns_" are used.

Method Detail

initialLocation

public void initialLocation(DTNHost host,
                            Coord location)
Description copied from interface: MovementListener
Method is called when a host receives its initial location from movement model.

Specified by:
initialLocation in interface MovementListener
Parameters:
host - The host that got the location
location - Coordinates of the location

newDestination

public void newDestination(DTNHost host,
                           Coord dst,
                           double speed)
Description copied from interface: MovementListener
Method is called every time a host receives a new destination from its movement model.

Specified by:
newDestination in interface MovementListener
Parameters:
host - The host that got a new destination
dst - Coordinates of the destination
speed - Speed towards that destination