prophet::Stats Class Reference

Container for Bundle statistics, indexed by Bundle identifier. More...

#include <Stats.h>

List of all members.

Public Member Functions

 Stats ()
 Default constructor.
 ~Stats ()
 Destructor.
void update_stats (const Bundle *b, double p)
 Given a Bundle and a predictability value, update the stats kept for that Bundle.
double get_p_max (const Bundle *b) const
 Given a Bundle, return the max predictability for any route over which this Bundle has been forwarded.
double get_mopr (const Bundle *b) const
 Given a Bundle, return the predictability favor for the routes over which this Bundle has been forwarded, according to Eq.
double get_lmopr (const Bundle *b) const
 Given a Bundle, return the linear predictability favor for the routes over which this Bundle has been forwarded, according to Eq.
void drop_bundle (const Bundle *b)
 Bundle is no longer with us, so get rid of its stats.
u_int dropped () const
 Return count of how many Bundle stats have been dropped so far.
size_t size () const
 Return count of Bundles currently rep'd in Stats.

Protected Types

typedef std::map< u_int32_t,
StatsEntry * > 
pstats
typedef std::map< u_int32_t,
StatsEntry * >::iterator 
iterator
typedef std::map< u_int32_t,
StatsEntry * >::const_iterator 
const_iterator

Protected Member Functions

StatsEntryfind (const Bundle *b)
 Convenience function for finding the StatEntry per bundle id.

Protected Attributes

u_int dropped_
pstats pstats_

Detailed Description

Container for Bundle statistics, indexed by Bundle identifier.

Not thread-safe, requires external locking mechanism.

Definition at line 44 of file Stats.h.


Member Typedef Documentation

typedef std::map<u_int32_t,StatsEntry*>::const_iterator prophet::Stats::const_iterator [protected]

Definition at line 104 of file Stats.h.

typedef std::map<u_int32_t,StatsEntry*>::iterator prophet::Stats::iterator [protected]

Definition at line 102 of file Stats.h.

typedef std::map<u_int32_t,StatsEntry*> prophet::Stats::pstats [protected]

Definition at line 101 of file Stats.h.


Constructor & Destructor Documentation

prophet::Stats::Stats (  )  [inline]

Default constructor.

Definition at line 50 of file Stats.h.

prophet::Stats::~Stats (  ) 

Destructor.

Definition at line 22 of file Stats.cc.

References pstats_.


Member Function Documentation

void prophet::Stats::drop_bundle ( const Bundle b  ) 

Bundle is no longer with us, so get rid of its stats.

Definition at line 96 of file Stats.cc.

References dropped_, pstats_, and prophet::Bundle::sequence_num().

Referenced by prophet::Oracle::ack().

u_int prophet::Stats::dropped (  )  const [inline]

Return count of how many Bundle stats have been dropped so far.

Definition at line 93 of file Stats.h.

References dropped_.

StatsEntry * prophet::Stats::find ( const Bundle b  )  [protected]

Convenience function for finding the StatEntry per bundle id.

Definition at line 74 of file Stats.cc.

References pstats_, and prophet::Bundle::sequence_num().

Referenced by get_lmopr(), get_mopr(), get_p_max(), and update_stats().

double prophet::Stats::get_lmopr ( const Bundle b  )  const

Given a Bundle, return the linear predictability favor for the routes over which this Bundle has been forwarded, according to Eq.

8, Section 3.7

Definition at line 67 of file Stats.cc.

References find(), and prophet::StatsEntry::lmopr_.

Referenced by prophet::QueueCompLMOPR::operator()().

double prophet::Stats::get_mopr ( const Bundle b  )  const

Given a Bundle, return the predictability favor for the routes over which this Bundle has been forwarded, according to Eq.

7, Section 3.7

Definition at line 60 of file Stats.cc.

References find(), and prophet::StatsEntry::mopr_.

Referenced by prophet::QueueCompMOPR::operator()().

double prophet::Stats::get_p_max ( const Bundle b  )  const

Given a Bundle, return the max predictability for any route over which this Bundle has been forwarded.

Definition at line 53 of file Stats.cc.

References find(), and prophet::StatsEntry::p_max_.

Referenced by prophet::FwdDeciderGTMXPLUS::operator()(), and prophet::FwdDeciderGRTRPLUS::operator()().

size_t prophet::Stats::size (  )  const [inline]

Return count of Bundles currently rep'd in Stats.

Definition at line 98 of file Stats.h.

References pstats_.

void prophet::Stats::update_stats ( const Bundle b,
double  p 
)

Given a Bundle and a predictability value, update the stats kept for that Bundle.

Definition at line 32 of file Stats.cc.

References find(), prophet::StatsEntry::lmopr_, prophet::StatsEntry::mopr_, and prophet::StatsEntry::p_max_.

Referenced by prophet::Controller::handle_bundle_transmitted().


Member Data Documentation

u_int prophet::Stats::dropped_ [protected]

Definition at line 111 of file Stats.h.

Referenced by drop_bundle(), and dropped().

pstats prophet::Stats::pstats_ [mutable, protected]

Definition at line 112 of file Stats.h.

Referenced by drop_bundle(), find(), size(), and ~Stats().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 13:21:33 2010 for DTN Reference Implementation by  doxygen 1.6.3