Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members

SourceState Class Reference

#include <netelem.h>

List of all members.

Public Member Functions

 SourceState (Distrib *duration, Distrib *interarrival, int samplesize)
virtual ~SourceState (void)
int GetSampleSize (void) const
timeunits GetDuration (void) const
virtual timeunits GetInterarrival (void) const
void AddToPacketCount (int n)


Detailed Description

Auxiliary class to implement state-based sources, such as ON-OFF sources. A state lasts for a given duration, generating data units of samplesize bits at a given rate.


Constructor & Destructor Documentation

SourceState::SourceState Distrib duration,
Distrib interarrival,
int  samplesize
 

The distribution objects will be deleted by the destructor.

Parameters:
duration pointer to a distribution that describes the permanence time in this state.
interarrival pointer to a distribution that describes the interarrival process between packets.
samplesize constant size, in bits, of the packets generated in this state.
Note:
it generates and enqueues a complete burst, to avoid wasting time. Hence, the state duration must be finite. If this is not the case, don't use this NetElement.

SourceState::~SourceState void   )  [virtual]
 

Deletes the distribution objects.


Member Function Documentation

timeunits SourceState::GetDuration void   )  const
 

Returns:
next permanence time, in timeunits, in this state, according to the duration distribution.

timeunits SourceState::GetInterarrival void   )  const [virtual]
 

Returns:
time to wait to generate the next packet, in timeunits, according to the interarrival distribution.

int SourceState::GetSampleSize void   )  const
 

Returns:
constant size, in bits, of the packets generated in this state.


The documentation for this class was generated from the following files:
Generated on Fri Jan 19 15:35:17 2007 by  doxygen 1.4.2