report
Class ContactTimesReport

java.lang.Object
  extended by report.Report
      extended by report.ContactTimesReport
All Implemented Interfaces:
ConnectionListener
Direct Known Subclasses:
InterContactTimesReport, TotalContactTimeReport

public class ContactTimesReport
extends Report
implements ConnectionListener

Reports the node contact time (i.e., how long they were in the range of each other) distribution. Report file contains the count of connections that lasted for certain amount of time. Syntax:
time nrofContacts


Nested Class Summary
protected  class ContactTimesReport.ConnectionInfo
          Objects of this class store time information about contacts.
 
Field Summary
protected  java.util.HashMap<ContactTimesReport.ConnectionInfo,ContactTimesReport.ConnectionInfo> connections
           
protected  double granularity
          How many seconds are grouped in one group
static java.lang.String GRANULARITY
          Granularity -setting id ("granularity").
 
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
ContactTimesReport()
          Constructor.
 
Method Summary
protected  void addConnection(DTNHost host1, DTNHost host2)
           
 void done()
          Called when the simulation is done, user requested premature termination or intervalled report generating decided that it's time for the next report.
 void hostsConnected(DTNHost host1, DTNHost host2)
          Method is called when two hosts are connected.
 void hostsDisconnected(DTNHost host1, DTNHost host2)
          Method is called when connection between hosts is disconnected.
protected  void increaseTimeCount(double time)
          Increases the amount of times a certain time value has been seen.
protected  void init()
          Initializes the report output.
protected  ContactTimesReport.ConnectionInfo removeConnection(DTNHost host1, DTNHost host2)
           
 
Methods inherited from class report.Report
addWarmupID, format, getAverage, getIntAverage, getIntMedian, getMedian, getScenarioName, getSettings, getSimTime, getVariance, 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

connections

protected java.util.HashMap<ContactTimesReport.ConnectionInfo,ContactTimesReport.ConnectionInfo> connections

GRANULARITY

public static final java.lang.String GRANULARITY
Granularity -setting id ("granularity"). Defines how many simulated seconds are grouped in one reported interval.

See Also:
Constant Field Values

granularity

protected double granularity
How many seconds are grouped in one group

Constructor Detail

ContactTimesReport

public ContactTimesReport()
Constructor.

Method Detail

init

protected void init()
Description copied from class: Report
Initializes the report output. Method is called in the beginning of every new report file. Subclasses must call this method first in their own implementations of init().

Overrides:
init in class Report

hostsConnected

public void hostsConnected(DTNHost host1,
                           DTNHost host2)
Description copied from interface: ConnectionListener
Method is called when two hosts are connected.

Specified by:
hostsConnected in interface ConnectionListener
Parameters:
host1 - Host that initiated the connection
host2 - Host that was connected to

hostsDisconnected

public void hostsDisconnected(DTNHost host1,
                              DTNHost host2)
Description copied from interface: ConnectionListener
Method is called when connection between hosts is disconnected.

Specified by:
hostsDisconnected in interface ConnectionListener
Parameters:
host1 - Host that initiated the disconnection
host2 - Host at the other end of the connection

addConnection

protected void addConnection(DTNHost host1,
                             DTNHost host2)

removeConnection

protected ContactTimesReport.ConnectionInfo removeConnection(DTNHost host1,
                                                             DTNHost host2)

increaseTimeCount

protected void increaseTimeCount(double time)
Increases the amount of times a certain time value has been seen.

Parameters:
time - The time value that was seen

done

public void done()
Description copied from class: Report
Called when the simulation is done, user requested premature termination or intervalled report generating decided that it's time for the next report.

Overrides:
done in class Report