|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
ptolemy.kernel.Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
ptolemy.actor.TypedIOPort |
input
This is a multiport of type RecordToken that will be merged |
ptolemy.actor.TypedIOPort |
output
This will contain all merged RecordTokens, if there are any |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
ModelRailwayMerge(ptolemy.kernel.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 ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, clone, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class ptolemy.kernel.util.NamedObj |
---|
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, preinitialize, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public ptolemy.actor.TypedIOPort input
public ptolemy.actor.TypedIOPort output
Constructor Detail |
---|
public ModelRailwayMerge(ptolemy.kernel.CompositeEntity container, String name) throws ptolemy.kernel.util.NameDuplicationException, ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.NameDuplicationException
ptolemy.kernel.util.IllegalActionException
Method Detail |
---|
public void fire() throws ptolemy.kernel.util.IllegalActionException
fire
in interface ptolemy.actor.Executable
fire
in class ptolemy.actor.AtomicActor
ptolemy.kernel.util.IllegalActionException
- If calling send() or super.fire()
throws it.public void initialize() throws ptolemy.kernel.util.IllegalActionException
initialize
in interface ptolemy.actor.Initializable
initialize
in class ptolemy.actor.AtomicActor
ptolemy.kernel.util.IllegalActionException
- If the parent class throws it.public void wrapup() throws ptolemy.kernel.util.IllegalActionException
wrapup
in interface ptolemy.actor.Initializable
wrapup
in class ptolemy.actor.AtomicActor
ptolemy.kernel.util.IllegalActionException
- Not thrown in this base class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |