|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinput.MessageEventGenerator
public class MessageEventGenerator
Message creation -external events generator. Creates uniformly distributed message creation patterns whose message size and inter-message intervals can be configured.
Field Summary | |
---|---|
static java.lang.String |
HOST_RANGE_S
Sender/receiver address range -setting id ("hosts"). |
protected int[] |
hostRange
Range of host addresses that can be senders or receivers |
protected java.lang.String |
idPrefix
Prefix for the messages |
static java.lang.String |
MESSAGE_ID_PREFIX_S
Message ID prefix -setting id ("prefix"). |
static java.lang.String |
MESSAGE_INTERVAL_S
Message creation interval range -setting id ("interval"). |
static java.lang.String |
MESSAGE_SIZE_S
Message size range -setting id ("size"). |
static java.lang.String |
MESSAGE_TIME_S
Message creation time range -setting id ("time"). |
protected double[] |
msgTime
Time range for message creation (min, max) |
protected double |
nextEventsTime
Time of the next event (simulated seconds) |
protected java.util.Random |
rng
Random number generator for this Class |
static java.lang.String |
TO_HOST_RANGE_S
(Optional) receiver address range -setting id ("tohosts"). |
protected int[] |
toHostRange
Range of host addresses that can be receivers |
Constructor Summary | |
---|---|
MessageEventGenerator(Settings s)
Constructor, initializes the interval between events, and the size of messages generated, as well as number of hosts in the network. |
Method Summary | |
---|---|
protected int |
drawHostAddress(int[] hostRange)
Draws a random host address from the configured address range |
protected int |
drawMessageSize()
Generates a (random) message size |
protected int |
drawNextEventTimeDiff()
Generates a (random) time difference between two events |
protected int |
drawToAddress(int[] hostRange,
int from)
Draws a destination host address that is different from the "from" address |
protected java.lang.String |
getID()
Returns a next free message ID |
ExternalEvent |
nextEvent()
Returns the next message creation event |
double |
nextEventsTime()
Returns next message creation event's time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MESSAGE_SIZE_S
public static final java.lang.String MESSAGE_INTERVAL_S
public static final java.lang.String HOST_RANGE_S
public static final java.lang.String TO_HOST_RANGE_S
HOST_RANGE_S
setting's range.
The lower bound is inclusive and upper bound exclusive.
public static final java.lang.String MESSAGE_ID_PREFIX_S
public static final java.lang.String MESSAGE_TIME_S
protected double nextEventsTime
protected int[] hostRange
protected int[] toHostRange
protected java.lang.String idPrefix
protected double[] msgTime
protected java.util.Random rng
Constructor Detail |
---|
public MessageEventGenerator(Settings s)
s
- Settings for this generator.Method Detail |
---|
protected int drawHostAddress(int[] hostRange)
hostRange
- The range of hosts
protected int drawMessageSize()
protected int drawNextEventTimeDiff()
protected int drawToAddress(int[] hostRange, int from)
hostRange
- The range of hostsfrom
- the "from" address
public ExternalEvent nextEvent()
nextEvent
in interface EventQueue
EventQueue.nextEvent()
public double nextEventsTime()
nextEventsTime
in interface EventQueue
EventQueue.nextEventsTime()
protected java.lang.String getID()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |