public abstract class Generator extends Entity
getNextEventTime
to calculate the time for the next message to
be generated.
Each Generator has to have exactly one MessageFactory. If no MessageFactory is provided, Generator creates a new MessageFactory with an default Message of type Message and length 1.
Entity.PortAlias
Modifier and Type | Field and Description |
---|---|
protected boolean |
activated |
protected Event |
event |
protected Factory<Message> |
messageFactory |
protected SynchronousOutputPort |
outputPort |
portAliases, ports, simNode
Modifier | Constructor and Description |
---|---|
protected |
Generator(java.lang.String name,
SimNode owner) |
protected |
Generator(java.lang.String name,
SimNode owner,
Factory<Message> factory,
boolean activateOnStart) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected Message |
createMessage() |
void |
deactivate() |
Factory |
getMessageFactory() |
protected abstract double |
getNextEventTime(double currentTime) |
OutputPort |
getOutput() |
void |
setActivated(boolean start) |
void |
setMessageFactory(Factory<Message> Factory) |
addPort, aliasPort, aliasPort, connect, disconnect, getName, getNode, getPortByName, getPorts, isPortKnown, unaliasPort
protected SynchronousOutputPort outputPort
protected Event event
protected boolean activated
protected Generator(java.lang.String name, SimNode owner, Factory<Message> factory, boolean activateOnStart)
protected Generator(java.lang.String name, SimNode owner)
protected abstract double getNextEventTime(double currentTime)
protected Message createMessage()
public void setActivated(boolean start)
public final void activate()
public final void deactivate()
public Factory getMessageFactory()
public OutputPort getOutput()