public class RandomTimeDistribution extends java.lang.Object implements PacketTimeDistribution
| Constructor and Description |
|---|
RandomTimeDistribution()
Constructs a new RandomTimeDistribution with default minimum and maximum
packet transmission rates.
|
RandomTimeDistribution(int upperOrLowerBound)
Constructs a RandomTimeDistribution with one default parameter, and a
specified minimum or maximum, depending upon the exact value specified.
|
RandomTimeDistribution(int bound1,
int bound2)
Constructs a new RandomTimeDistribution with the specified upper and
lower bounds on intervals between packet transmissions.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxInterval() |
int |
getMinInterval() |
int |
getType() |
int |
nextInterval()
Calculates the next interval at which a packet should be sent in a random
distribution.
|
int[] |
prediction(int size)
Generates an array containing predicted packet transmission times, in
terms of number of ms from this instant.
|
void |
setIntervalBounds(int bound1,
int bound2)
Sets the minimum and maximum intervals for packet transmissions to the
specified bounds.
|
void |
setMaxInterval(int newMaxInterval) |
void |
setMinInterval(int newMinInterval) |
public RandomTimeDistribution()
public RandomTimeDistribution(int upperOrLowerBound)
upperOrLowerBound - the wanted minimum (if less than the default
minimum) or maximum (if greater than the default minimum) packet
transmission interval in ms, for this RandomTimeDistributionpublic RandomTimeDistribution(int bound1,
int bound2)
bound1 - the first bound (either min or max) on packet transmission
intervals (in ms)bound2 - the second bound (either min or max) on packet transmission
intervals (in ms)public int getMinInterval()
public void setMinInterval(int newMinInterval)
public int getMaxInterval()
public void setMaxInterval(int newMaxInterval)
public void setIntervalBounds(int bound1,
int bound2)
bound1 - the first bound (either min or max) on packet transmission
intervalsbound2 - the second bound (either min or max) on packet transmission
intervalspublic int getType()
getType in interface PacketTimeDistributionpublic int nextInterval()
nextInterval in interface PacketTimeDistributionpublic int[] prediction(int size)
PacketTimeDistributionprediction in interface PacketTimeDistributionsize - the number of predictions contained in the returned array