|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTypedAtomicActor
ptolemy.actor.kiel.ModelRailwayMerge
public class ModelRailwayMerge
Merges one or more RecordTokens which normally contain action commands for the Model Railway (or its simulation). This is needed because there is only at most one ModelRailwayIO Actor as an interface but several concurrent threads may which to set commands (e.g., setting signals, track speeds or switch points). The merging is done in a non-strict fashion, meaning that not all inputs (of the multiport) must be present. Only present ones are merged. If there are no inputs, no tokens will be sent out in this tick. This actor is designed to work in the SR domain. It will give precedence to later connected thread-Actors, meaning they can override previous commands in that tick (if two or more Actors send the same command). This guarantees the I/O-equivalence betweeen this and the generated c-code implementation.
Field Summary | |
---|---|
TypedIOPort |
input
This is a multiport of type RecordToken that will be merged |
TypedIOPort |
output
This will contain all merged RecordTokens, if there are any |
Constructor Summary | |
---|---|
ModelRailwayMerge(CompositeEntity container,
String name)
|
Method Summary | |
---|---|
void |
fire()
Collect all tokens from the inputs, if there are any (non-strict). |
void |
initialize()
Set the RailwayInterface and open a TCP connection to the Model Railway interface program w/ the given host and port parameters. |
void |
wrapup()
Terminate the TCP connection of the Model Railway interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public TypedIOPort input
public TypedIOPort output
Constructor Detail |
---|
public ModelRailwayMerge(CompositeEntity container, String name) throws NameDuplicationException, IllegalActionException
NameDuplicationException
IllegalActionException
Method Detail |
---|
public void fire() throws IllegalActionException
IllegalActionException
- If calling send() or super.fire()
throws it.public void initialize() throws IllegalActionException
IllegalActionException
- If the parent class throws it.public void wrapup() throws IllegalActionException
IllegalActionException
- Not thrown in this base class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |