public class GreedyGenerator extends Entity implements ReflectionConstructable2<SimNode,Parameters>
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
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
GreedyGenerator(DiscreteDistribution lengthdist,
SimNode ownNode) |
GreedyGenerator(DiscreteDistribution lengthdist,
SimNode ownNode,
Factory<Message> factory) |
GreedyGenerator(DiscreteDistribution lengthdist,
SimNode ownNode,
Factory<Message> factory,
boolean activateOnStart) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
static GreedyGenerator |
createInstance(SimNode ownNode,
Parameters pars)
as required by
ReflectionConstructable |
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, SimNode ownNode, Factory<Message> factory, boolean activateOnStart)
public GreedyGenerator(DiscreteDistribution lengthdist, SimNode ownNode, Factory<Message> factory)
public GreedyGenerator(DiscreteDistribution lengthdist, SimNode ownNode)
public static GreedyGenerator createInstance(SimNode ownNode, Parameters pars)
ReflectionConstructable
protected Message createMessage()
public void setActivated(boolean start)
public void activate()
public void deactivate()
public DiscreteDistribution getLengthDist()
protected boolean handleIsMessageAvailable(Port port)