Class CatchUpComposite
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,HandlesInternalLinks
public class CatchUpComposite extends MirrorComposite
This composite allows events to occur in the inside model between the times when the outside model invokes this composite. The inside model is required to have a director.When this composite actor is fired, it fires the inside model to process any unprocessed events it may have at earlier times than the environment time of the firing. If in any of these "catch up" firings the inside model attempts to produce outputs, this director will throw an exception. This director then transfers any available inputs to the inside model and fires the inside model one more time. On this "caught up" firing, the inside model is permitted to produce outputs.
By default, if an actor contained by this composite requests a firing at a future time, then that request is passed up to the containing director. If fireOnlyWhenTriggered is set to true, however, then such requests are not passed up. In this case, the next firing will occur whenever the container has an input to provide to this composite, and catching up will occur only at that time. Note that if this composite produces outputs, you have to be very careful to ensure that those outputs are produced only at times when an input trigger is provided.
Note that a firing of this composite results in one or more complete iterations of the inside model, including invocations of postfire. Thus, this actor changes state in the fire() method, and hence only implements the weak actor semantics. Therefore, it should not be used inside domains that require a strict actor semantics, such as Continuous, which requires that fire() not change state (so that backtracking can occur). This composite probably can be used in SR, where it will be treated as a strict as actor and hence will be fired only once per iteration, and only when all inputs are known.
- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (neuendor)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CatchUpComposite.Contents
Contents composite that overrides the base class to have a parameter indicating whether to fire only when triggered.-
Nested classes/interfaces inherited from class ptolemy.actor.lib.hoc.MirrorComposite
MirrorComposite.MirrorCompositeContents
-
Nested classes/interfaces inherited from class ptolemy.actor.lib.hoc.ReflectComposite
ReflectComposite.ReflectCompositeContents
-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.lib.hoc.ReflectComposite
_inAddPort, _inRemoveEntity, _mirrorParameterPorts
-
Fields inherited from class ptolemy.actor.CompositeActor
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
-
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _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
Constructors Constructor Description CatchUpComposite(CompositeEntity container, java.lang.String name)
Create an actor with a name and a container.CatchUpComposite(Workspace workspace)
Construct a CatchUpComposite in the specified workspace with no container and an empty string as a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone(Workspace workspace)
Clone the object into the specified workspace.void
fire()
Fire any piggybacked actors and then delegate the firing to the director.-
Methods inherited from class ptolemy.actor.lib.hoc.MirrorComposite
_addPort, _mirrorPort
-
Methods inherited from class ptolemy.actor.lib.hoc.ReflectComposite
_addEntity, _exportMoMLContents, _removeEntity, _removePort, newParameterPort, newPort
-
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeChanged, attributeTypeChanged, isBackwardTypeInferenceEnabled, newRelation, resolveTypes, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort, wrapup
-
Methods inherited from class ptolemy.kernel.CompositeEntity
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, 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.Entity
connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, 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, 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.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
CatchUpComposite
public CatchUpComposite(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create an actor with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.- Parameters:
container
- The container actor.name
- The name of this actor.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name coincides with an actor already in the container.
-
CatchUpComposite
public CatchUpComposite(Workspace workspace) throws IllegalActionException, NameDuplicationException
Construct a CatchUpComposite in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.- Parameters:
workspace
- The workspace that will list the actor.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name of the director coincides with an actor already in the container.
-
-
Method Detail
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Clone the object into the specified workspace. This overrides the base class to instantiate a new CatchUpDirector.- Overrides:
clone
in classReflectComposite
- Parameters:
workspace
- The workspace for the new object.- Returns:
- A new NamedObj.
- Throws:
java.lang.CloneNotSupportedException
- If any of the attributes cannot be cloned.- See Also:
CompositeEntity.exportMoML(Writer, int, String)
-
fire
public void fire() throws IllegalActionException
Fire any piggybacked actors and then delegate the firing to the director. This overrides the base class to not transfer inputs or outputs. Those operations are handled by the director.- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classCompositeActor
- Throws:
IllegalActionException
- If there is no director, or if the director's fire() method throws it, or if the actor is not opaque.
-
-