input
Class MessageEventGenerator

java.lang.Object
  extended by input.MessageEventGenerator
All Implemented Interfaces:
EventQueue

public class MessageEventGenerator
extends java.lang.Object
implements EventQueue

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").
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 nextEventsTime
          Time of the next event (simulated seconds)
static java.lang.String TO_HOST_RANGE_S
          (Optional) receiver address range -setting id ("tohosts").
 
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
 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

MESSAGE_SIZE_S

public static final java.lang.String MESSAGE_SIZE_S
Message size range -setting id ("size"). Can be either a single value or a range (min, max) of uniformly distributed random values. Defines the message size (bytes).

See Also:
Constant Field Values

MESSAGE_INTERVAL_S

public static final java.lang.String MESSAGE_INTERVAL_S
Message creation interval range -setting id ("interval"). Can be either a single value or a range (min, max) of uniformly distributed random values. Defines the inter-message creation interval (seconds).

See Also:
Constant Field Values

HOST_RANGE_S

public static final java.lang.String HOST_RANGE_S
Sender/receiver address range -setting id ("hosts"). The lower bound is inclusive and upper bound exclusive.

See Also:
Constant Field Values

TO_HOST_RANGE_S

public static final java.lang.String TO_HOST_RANGE_S
(Optional) receiver address range -setting id ("tohosts"). If a value for this setting is defined, the destination hosts are selected from this range and the source hosts from the HOST_RANGE_S setting's range. The lower bound is inclusive and upper bound exclusive.

See Also:
Constant Field Values

MESSAGE_ID_PREFIX_S

public static final java.lang.String MESSAGE_ID_PREFIX_S
Message ID prefix -setting id ("prefix"). The value must be unique for all message sources, so if you have more than one message generator, use different prefix for all of them. The random number generator's seed is derived from the prefix, so by changing the prefix, you'll get also a new message sequence.

See Also:
Constant Field Values

MESSAGE_TIME_S

public static final java.lang.String MESSAGE_TIME_S
Message creation time range -setting id ("time"). Defines the time range when messages are created. No messages are created before the first and after the second value. By default, messages are created for the whole simulation time.

See Also:
Constant Field Values

nextEventsTime

protected double nextEventsTime
Time of the next event (simulated seconds)

Constructor Detail

MessageEventGenerator

public MessageEventGenerator(Settings s)
Constructor, initializes the interval between events, and the size of messages generated, as well as number of hosts in the network.

Parameters:
s - Settings for this generator.
Method Detail

nextEvent

public ExternalEvent nextEvent()
Returns the next message creation event

Specified by:
nextEvent in interface EventQueue
Returns:
The next event
See Also:
EventQueue.nextEvent()

nextEventsTime

public double nextEventsTime()
Returns next message creation event's time

Specified by:
nextEventsTime in interface EventQueue
Returns:
Next event's time
See Also:
EventQueue.nextEventsTime()