public class StdGenerator extends Generator
StdGenerator
generates messages according to a renewal point
process for which IAT distribution is provided. If a distribution for the
length of a message is provided, it sets the message length in an iid
fashion. That is, each time a message is created, the message length is drawn
according to the given distribution. A MessageFactory
may be provided
to create messages other than Message
.
If a length distribution is provided, the length of the default Message
generated by the MessageFactory
is overwritten.
StdGenerator is a very flexible Generator with the following characteristics:
MessageFactory
, the length is adapted
by calling setLength()
of the message and passing the new length
according to the length distribution.
MessageFactory
.
StdGenerator
.
Entity.PortAlias
Modifier and Type | Field and Description |
---|---|
protected ContinuousDistribution |
interArrivalTime |
protected DiscreteDistribution |
messageLengthDist |
activated, currentEventToken, messageFactory, outputPort
portAliases, ports, simNode
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
StdGenerator(ContinuousDistribution iat,
DiscreteDistribution lengthdist,
SimNode ownNode,
Factory<Message> factory,
boolean activateOnStart) |
Modifier and Type | Method and Description |
---|---|
static StdGenerator |
createInstance(SimNode ownNode,
Parameters pars)
as required by
ReflectionConstructable |
protected Message |
createMessage() |
protected PointInTime |
getNextEventTime(PointInTime currentTime) |
activate, deactivate, getMessageFactory, getOutput, handleProcessEvent, setActivated, setMessageFactory
addPort, aliasPort, aliasPort, connect, disconnect, getName, getNode, getPortByName, getPorts, isPortKnown, unaliasPort
protected final ContinuousDistribution interArrivalTime
protected final DiscreteDistribution messageLengthDist
public StdGenerator(ContinuousDistribution iat, DiscreteDistribution lengthdist, SimNode ownNode, Factory<Message> factory, boolean activateOnStart)
iat
- Distribution for the interarrival timelengthdist
- Distribution for the message length. May be null, in that case
the message length is used as set by the factory.ownNode
- SimNode of the generatorfactory
- Factory used to create new message objects. May be null, in that
case a new MessageFactory
is created.activateOnStart
- If true, the generator automatically starts generating messages.
Otherwise, Generator.setActivated(boolean)
has to be called
manually.public static StdGenerator createInstance(SimNode ownNode, Parameters pars)
ReflectionConstructable
protected Message createMessage()
createMessage
in class Generator
protected PointInTime getNextEventTime(PointInTime currentTime)
getNextEventTime
in class Generator