00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_FRAME_STATS_TFI_PLOT_HH_
00023 # define WIFI_FRAME_STATS_TFI_PLOT_HH_
00024
00025 # include <boost/multi_array.hpp>
00026
00027 # include <wipal/wifi/frame/stats/abstract_stats.hh>
00028 # include <wipal/tool/microseconds.hh>
00029
00030 namespace wifi
00031 {
00032
00033 namespace frame
00034 {
00035
00036 namespace stats
00037 {
00038
00039 struct tfi_plot: public abstract_stats
00040 {
00041 tfi_plot();
00042
00043 void account_frame(unsigned frame_id,
00044 const tool::microseconds& arrival);
00045 void account_gap(unsigned gap_length);
00046 void account_miss();
00047
00048 void restart();
00049
00050 std::ostream& print(std::ostream& o) const;
00051
00052 private:
00053 void end_epoch(const tool::microseconds& new_epoch_start);
00054
00055 enum
00056 {
00057 epoch_length = 102400,
00058 score_step = 10,
00059 load_step = 1,
00060 load_max = 2048
00061 };
00062
00063 boost::multi_array<unsigned, 2> tfi_;
00064 tool::microseconds epoch_start_;
00065 unsigned total_;
00066 unsigned missed_;
00067 };
00068
00069 }
00070
00071 }
00072
00073 }
00074
00075 # include "tfi_plot.hxx"
00076
00077 #endif // ! WIFI_FRAME_STATS_TFI_PLOT_HH_