public class Combine extends TypedAtomicActor
red (cmot) |
red (cmot) |
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected int |
_ADD
Add.
|
protected int |
_AND
Logical And.
|
protected int |
_CONSTANT
Constant.
|
protected int |
_MAXIMUM
Maximum.
|
protected int |
_MINIMUM
Minimum.
|
protected int |
_MULTIPLY
Multiply.
|
protected int |
_NONE
Noop.
|
protected int |
_OR
Logical Or.
|
StringAttribute |
function
The function to compute a combine operation on signals.
|
TypedIOPort |
input
This is a multiport for input (known) signals.
|
TypedIOPort |
output
Output a signal here iff any connected input signal is known.
|
TypedIOPort |
value
Output a resulting value.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
Combine(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected int |
_updateFunction(int in,
int old)
Calculate the function on the given arguments.
|
void |
attributeChanged(Attribute attribute)
Override the base class to determine which function is being
specified.
|
void |
fire()
Collect the integer tokens of all available inputs and combine them
using the combine function.
|
void |
initialize()
Set the RailwayInterface and open a TCP connection to the
Model Railway interface program w/ the given host and
port parameters.
|
boolean |
isStrict()
This actor must be *NON-strict* because it must not wait for more than
one input within an SR director iteration.
|
boolean |
postfire()
Return true, unless stop() has been called, in which case,
return false.
|
boolean |
prefire()
Return true.
|
void |
wrapup()
Terminate the TCP connection of the Model Railway interface.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, 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, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, iterate, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public StringAttribute function
public TypedIOPort input
public TypedIOPort output
public TypedIOPort value
protected final int _NONE
protected final int _ADD
protected final int _MULTIPLY
protected final int _MAXIMUM
protected final int _MINIMUM
protected final int _OR
protected final int _AND
protected final int _CONSTANT
public Combine(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If calling send() or super.fire()
throws it.public boolean isStrict()
isStrict
in interface Executable
isStrict
in class AtomicActor<TypedIOPort>
public boolean prefire() throws IllegalActionException
AtomicActor
prefire
in interface Executable
prefire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.public boolean postfire() throws IllegalActionException
AtomicActor
postfire
in interface Executable
postfire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the parent class throws it.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.protected int _updateFunction(int in, int old) throws IllegalActionException
in
- The new input value. Should never be null.old
- The old result value, or null if there is none.IllegalActionException
- If thrown by BooleanToken operations.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the function is not recognized.