public class GreedyGenerator extends Entity
GreedyGenerator
generates as many messages as the attached
component can handle. That is, as soon as a message has been fetched, the
next one is generated and offered. The greedy generator only works with an
active receiver attached to it. If a distribution for the length of
a message is provided/parsed it sets the message length according to the
given distribution each time a message is created. 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.Entity.PortAlias
portAliases, ports, simNode
Constructor and Description |
---|
GreedyGenerator(DiscreteDistribution lengthdist,
java.lang.String name,
SimNode owner) |
GreedyGenerator(DiscreteDistribution lengthdist,
java.lang.String name,
SimNode owner,
Factory<Message> factory) |
GreedyGenerator(DiscreteDistribution lengthdist,
java.lang.String name,
SimNode owner,
Factory<Message> factory,
boolean activateOnStart) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected Message |
createMessage() |
void |
deactivate() |
DiscreteDistribution |
getLengthDist() |
protected Message |
handleGetMessage(Port port) |
protected boolean |
handleIsMessageAvailable(Port port) |
void |
setActivated(boolean start) |
addPort, aliasPort, aliasPort, connect, disconnect, getName, getNode, getPortByName, getPorts, isPortKnown, unaliasPort
public GreedyGenerator(DiscreteDistribution lengthdist, java.lang.String name, SimNode owner, Factory<Message> factory, boolean activateOnStart)
public GreedyGenerator(DiscreteDistribution lengthdist, java.lang.String name, SimNode owner, Factory<Message> factory)
public GreedyGenerator(DiscreteDistribution lengthdist, java.lang.String name, SimNode owner)
protected Message createMessage()
public void setActivated(boolean start)
public void activate()
public void deactivate()
public DiscreteDistribution getLengthDist()
protected boolean handleIsMessageAvailable(Port port)