|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpamvotis.sources.Source
public abstract class Source
This abstract class represents a source that generates packets. Objects of this class should not created. Create objects of the inherited class, that represent the type of source. This class is used by the simulation engine to add packets to a node's queue. The abstract classes getnextPacket and synchronize should be implemented from the inherited sources.
Field Summary | |
---|---|
int |
_sourceId
The Id of the source |
static java.util.Random |
generator
Generator for generating random variables |
int |
interArTime
The interarrival time of the packet to be generated. |
int |
packetToBeTransmittedID
The Id of the packet to be generated. |
int |
pktLength
The packet length of the packet to be generated. |
java.util.Vector<VirtualPacket> |
session
A vector of virtual packets representing a session of packets. |
static float |
slot
The time slot value according to the physical layer. |
static long |
timer
Represents the current time in slots. used for synchronization |
Constructor Summary | |
---|---|
Source()
|
Method Summary | |
---|---|
float |
genRv(char distr,
float mean)
Generates a random variable obeying a specific distribution. |
float |
genRv(char distr,
float mean,
float stDev)
Generates a random variable obeying a specific distribution. |
float |
genRv(char distr,
float mean,
float max,
float min)
Generates a random variable obeying a specific distribution. |
float |
genRv(char distr,
float mean,
float stDev,
float max,
float min)
Generates a random variable obeying a specific distribution. |
abstract void |
getNextPacket()
This abstract method is called by the source manager to get a packet generated by the packet source. |
abstract void |
synchronize()
This method is called by the simulator in every slot, to make synchronization procedures with the sources. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static float slot
public static java.util.Random generator
public int _sourceId
public static long timer
public int interArTime
public int pktLength
public int packetToBeTransmittedID
public java.util.Vector<VirtualPacket> session
Constructor Detail |
---|
public Source()
Method Detail |
---|
public float genRv(char distr, float mean, float stDev, float max, float min)
distr
- The distribution which the random variable will obey: 'c' for constant, 'e' for exponential,
'p' for Pareto, 'l' for lognormal. For Pareto, alfa=1.2 is always assumed.mean
- Mean value of the distributionstDev
- Standard deviation of the distribution (only available for some distributions)max
- Maximum value. If this value is set, truncation will occur using the accept/reject method and the variable will obviously obey
a truncated distribution. If you want to ommit this parameter, set it to Integer.MAX_VALUEmin
- Minimum value. If this value is set, truncation will occur using the accept/reject method and the variable will obviously obey
a truncated distribution. If you want to ommit this parameter, set it to -1.
public float genRv(char distr, float mean)
distr
- The distribution which the random variable will obey: 'c' for constant, 'e' for exponential,
'p' for Pareto.mean
- Mean value of the distribution
public float genRv(char distr, float mean, float stDev)
distr
- The distribution which the random variable will obey: 'c' for constant, 'e' for exponential,
'p' for Pareto, 'l' for lognormal. For Pareto, alfa=1.2 is always assumed.mean
- Mean value of the distributionstDev
- Standard deviation of the distribution (only available for some distributions)
public float genRv(char distr, float mean, float max, float min)
distr
- The distribution which the random variable will obey: 'c' for constant, 'e' for exponential,
'p' for Pareto, 'l' for lognormal. For Pareto, alfa=1.2 is always assumed.mean
- Mean value of the distributionmax
- Maximum value. If this value is set, truncation will occur using the accept/reject method and the variable will obviously obey
a truncated distribution.min
- Minimum value. If this value is set, truncation will occur using the accept/reject method and the variable will obviously obey
a truncated distribution.
public abstract void getNextPacket()
public abstract void synchronize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |