ptolemy.domains.sr.lib
Class EnabledComposite
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.domains.sr.lib.EnabledComposite
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class EnabledComposite
- extends TypedCompositeActor
A composite actor whose clock ticks only when enabled.
This actor will only have clock ticks when provided with a
true-valued token on the enabled input port. Thus, it can be
used to create subclocks of the master clock.
Note that this mechanism is a hierarchical version of what is
provided by the Lustre and SIGNAL clock calculi, but it
circumvents the undecidability of clock signals by requiring
the model designer to be explicit about subclocks.
P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice, "LUSTRE: A
Declarative Language for Programming Synchronous Systems,"
Conference Record of the 14th Annual ACM Symp. on Principles of
Programming Languages, Munich, Germany, January, 1987.
A. Benveniste and P. Le Guernic, "Hybrid Dynamical Systems Theory
and the SIGNAL Language," IEEE Tr. on Automatic Control, Vol. 35,
No. 5, pp. 525-546, May 1990.
- Since:
- Ptolemy II 4.1
- Version:
- $Id: EnabledComposite.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Edward A. Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary |
EnabledComposite(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified
name. |
Method Summary |
CausalityInterface |
getCausalityInterface()
Return a causality interface for this actor, which overrides the
default behavior of composite actors to ensure that all outputs
depend on the enable input port. |
boolean |
prefire()
If the enable input is not known, then return false;
if the enable input is known
and either absent or false, then also return false;
if it is known and true, then invoke the prefire() method of the
superclass and return what it returns. |
Methods inherited from class ptolemy.actor.CompositeActor |
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, fire, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, preinitialize, recordFiring, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, wrapup |
Methods inherited from class ptolemy.kernel.CompositeEntity |
_adjustDeferrals, _deepOpaqueEntityList, _description, _exportMoMLContents, _recordDecoratedAttributes, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, 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, 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 |
enable
public TypedIOPort enable
- The control port for enabling the composite.
EnabledComposite
public EnabledComposite(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct an actor in the specified container with the specified
name.
- Parameters:
container
- The container.name
- The name of this actor within the container.
- Throws:
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the name coincides with
an actor already in the container.
getCausalityInterface
public CausalityInterface getCausalityInterface()
- Return a causality interface for this actor, which overrides the
default behavior of composite actors to ensure that all outputs
depend on the enable input port.
- Specified by:
getCausalityInterface
in interface Actor
- Overrides:
getCausalityInterface
in class CompositeActor
- Returns:
- A representation of the dependencies between input ports
and output ports.
prefire
public boolean prefire()
throws IllegalActionException
- If the enable input is not known, then return false;
if the enable input is known
and either absent or false, then also return false;
if it is known and true, then invoke the prefire() method of the
superclass and return what it returns.
- Specified by:
prefire
in interface Executable
- Overrides:
prefire
in class CompositeActor
- Returns:
- True if the iteration can proceed.
- Throws:
IllegalActionException
- If the superclass throws it.