|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object TrafficGenerator
public class TrafficGenerator
A generator that tells how many packets sent and how big each packet is
for every time interval. This generator is used by
Output
entity
to generate junk packets or some background traffic.
This class uses eduni.simjava.distributions
package which is
available from SimJava2 only. If you want to use other distribution
package, then you need to wrap each source file with either
DiscreteGenerator
or
ContinuousGenerator
interface class.
DiscreteGenerator
,
ContinuousGenerator
Field Summary | |
---|---|
static int |
SEND_ALL
Sends junk packets to all entities at one time, including resources and/or users |
static int |
SEND_ONE_ONLY
Sends junk packets to one of the entities at one time using a normal distribution from java.util.Random.nextInt(int) |
Constructor Summary | |
---|---|
TrafficGenerator(ContinuousGenerator freq,
ContinuousGenerator timegen)
Creates a new background traffic generator. |
|
TrafficGenerator(ContinuousGenerator freq,
DiscreteGenerator timegen)
Creates a new background traffic generator. |
|
TrafficGenerator(DiscreteGenerator freq,
ContinuousGenerator timegen)
Creates a new background traffic generator. |
|
TrafficGenerator(DiscreteGenerator freq,
DiscreteGenerator timegen)
Creates a new background traffic generator. |
Method Summary | |
---|---|
long |
getNextPacketFreq()
Gets the next frequency or number of packets sent for each time. |
long |
getNextPacketSize()
Gets the next packet size. |
long |
getNextPacketTime()
Gets the next inter-arrival time between sending packets. |
int |
getPattern()
Gets the sending packet pattern |
int |
getServiceType()
Gets the service level of this packet. |
boolean |
setPacketSize(ContinuousGenerator sizegen)
Sets the size of each junk packet using a continuous distribution |
boolean |
setPacketSize(DiscreteGenerator sizegen)
Sets the size of each junk packet using a discrete distribution |
boolean |
setPattern(int pattern)
Sets the sending packet pattern if one or more entities are known. |
boolean |
setServiceType(int type)
Sets the service level of this packet. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SEND_ALL
public static final int SEND_ONE_ONLY
Constructor Detail |
---|
public TrafficGenerator(DiscreteGenerator freq, DiscreteGenerator timegen)
Link.DEFAULT_MTU
), a default service type (0),
and it will send to all resource entities and users (if applicable)
(SEND_ALL
).
freq
- a generator for frequency or number of packets sent at
one timetimegen
- a generator for inter-arrival sending time (second)public TrafficGenerator(ContinuousGenerator freq, ContinuousGenerator timegen)
Link.DEFAULT_MTU
), a default service type (0),
and it will send to all resource entities and users (if applicable)
(SEND_ALL
).
freq
- a generator for frequency or number of packets sent at
one timetimegen
- a generator for inter-arrival sending time (second)public TrafficGenerator(DiscreteGenerator freq, ContinuousGenerator timegen)
Link.DEFAULT_MTU
), a default service type (0),
and it will send to all resource entities and users (if applicable)
(SEND_ALL
).
freq
- a generator for frequency or number of packets sent at
one timetimegen
- a generator for inter-arrival sending time (second)public TrafficGenerator(ContinuousGenerator freq, DiscreteGenerator timegen)
Link.DEFAULT_MTU
), a default service type (0),
and it will send to all resource entities and users (if applicable)
(SEND_ALL
).
freq
- a generator for frequency or number of packets sent at
one timetimegen
- a generator for inter-arrival sending time (second)Method Detail |
---|
public boolean setPattern(int pattern)
SEND_ALL
: sends to all resources and users (if known)
SEND_ONE_ONLY
: sends to only one of them
pattern
-
public int getPattern()
public boolean setPacketSize(ContinuousGenerator sizegen)
sizegen
- a generator for each packet size
public boolean setPacketSize(DiscreteGenerator sizegen)
sizegen
- a generator for each packet size
public long getNextPacketTime()
public long getNextPacketFreq()
public long getNextPacketSize()
Link.DEFAULT_MTU
.
For using continuous distribution, the value is rounded up to the
nearest integer number.
public int getServiceType()
public boolean setServiceType(int type)
type
- the service level of this packet
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |