File: rate-estimator.h

package info (click to toggle)
ns2 2.35%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 78,756 kB
  • ctags: 27,476
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 812; awk: 525; csh: 355
file content (25 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef ns_rate_estimator_h
#define ns_rate_estimator_h

#include "packet.h"

//copied over from csfq.cc (Stoica)
class RateEstimator {
 public:
  double k_;                    /* averaging interval for rate estimation in seconds*/
  double estRate_;              /* current flow's estimated rate in bps */
  double bytesArr_;
  
  RateEstimator();
  RateEstimator(double estimate);
  void estimateRate(Packet *p);
  void reset();
  
protected:
  int temp_size_;               /* keep track of packets that arrive at the same time */
  double prevTime_;             /* time of last packet arrival */
  double reset_time_;
};
  
  
#endif