#include <trf_gen_v3.h>
Public Member Functions | |
Stream () | |
virtual | ~Stream () |
virtual void | SetLoad (load_t) |
void | SetLoadRecursive (load_t load) |
void | Reset (void) |
bytestamp_t | GetArrival (void) const |
burst_size_t | GetBurstSize (void) const |
void | ExtractBurst (void) |
Private Member Functions | |
virtual burst_size_t | NextBurstSize (void) |
virtual pause_size_t | NextPauseSize (void) |
Private Attributes | |
burst_size_t | BurstSize |
int | id |
Friends | |
class | PacketGenerator |
Definition at line 127 of file trf_gen_v3.h.
GEN::Stream::Stream | ( | ) | [inline] |
Definition at line 145 of file trf_gen_v3.h.
00145 : AVL::AVLNode< bytestamp_t >( 0 ) 00146 { 00147 BurstSize = 0; 00148 }
virtual GEN::Stream::~Stream | ( | ) | [inline, virtual] |
void GEN::Stream::ExtractBurst | ( | void | ) | [inline] |
Definition at line 201 of file trf_gen_v3.h.
00202 { 00203 BurstTime += BurstSize + NextPauseSize(); // Update BurstTime to point to 00204 // PauseSize after the end of burst. 00205 00206 BurstSize = NextBurstSize(); // Get next burst size. 00207 // This burst starts at BurstTime.stica’ no se declaró en este 00208 00209 00210 }
bytestamp_t GEN::Stream::GetArrival | ( | void | ) | const [inline] |
burst_size_t GEN::Stream::GetBurstSize | ( | void | ) | const [inline] |
virtual burst_size_t GEN::Stream::NextBurstSize | ( | void | ) | [inline, private, virtual] |
Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.
Definition at line 139 of file trf_gen_v3.h.
virtual pause_size_t GEN::Stream::NextPauseSize | ( | void | ) | [inline, private, virtual] |
Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.
Definition at line 140 of file trf_gen_v3.h.
void GEN::Stream::Reset | ( | void | ) | [inline] |
Definition at line 167 of file trf_gen_v3.h.
00168 { 00169 00170 00171 BurstSize = NextBurstSize(); 00172 BurstTime = NextPauseSize() + BurstSize; 00173 00174 00175 // quick start: simulate start at random time during ON- or OFF-period 00176 bytestamp_t start_time = (bytestamp_t)uniform( 0, (rnd_real_t)BurstTime ); 00177 00178 00179 if( start_time < BurstSize ) // zero time fell on ON period 00180 { 00181 BurstSize -= (burst_size_t)start_time; 00182 BurstTime = 0; 00183 } 00184 else // zero time fell on OFF period 00185 { 00186 BurstSize = NextBurstSize(); 00187 BurstTime -= start_time; 00188 } 00189 00190 }
virtual void GEN::Stream::SetLoad | ( | load_t | ) | [inline, virtual] |
Reimplemented in GEN::StreamPareto, GEN::StreamExpon, and GEN::StreamCBR.
Definition at line 155 of file trf_gen_v3.h.
void GEN::Stream::SetLoadRecursive | ( | load_t | load | ) | [inline] |
friend class PacketGenerator [friend] |
Definition at line 132 of file trf_gen_v3.h.
burst_size_t GEN::Stream::BurstSize [private] |
int GEN::Stream::id [private] |
Definition at line 136 of file trf_gen_v3.h.