Package ptolemy.domains.tm.lib
Class TMCompositeFacade
- java.lang.Object
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- Actor,- Executable,- FiringsRecordable,- Initializable,- TypedActor,- TMActor,- Changeable,- Debuggable,- DebugListener,- Derivable,- Instantiable,- ModelErrorHandler,- MoMLExportable,- Moveable,- Nameable
 
 public class TMCompositeFacade extends TypedCompositeActor implements TMActor A facade for a composite actor that creates and executes its internal model a background processFIXME: EXPERIMENTAL. - Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Jie Liu
- Pt.AcceptedRating:
- Red (liuj)
- Pt.ProposedRating:
- Red (liuj)
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntityCompositeEntity.ContainedObjectsIterator
 
- 
 - 
Field SummaryFields Modifier and Type Field Description ParameterexecutionTimeThe default execution time.ParameterpriorityPriority of the background process.- 
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.ExecutableCOMPLETED, NOT_READY, STOP_ITERATING
 
- 
 - 
Constructor SummaryConstructors Constructor Description TMCompositeFacade(CompositeEntity container, java.lang.String name)Construct an actor with the specified container and name.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_transferInputs()Transfer inputs from the ports.protected void_transferOutputs()Transfer outputs from the ports.voidattributeChanged(Attribute attribute)update local cache of executionTime.voidfire()If this actor is opaque, transfer any data from the input ports of this composite to the ports connected on the inside, and then invoke the fire() method of its local director.doublegetExecutionTime()Return the execution time for this iteration.booleanpostfire()If this actor is opaque, invoke the postfire() method of its local director and transfer output data.booleanprefire()If this actor is opaque, invoke the prefire() method of the local director.voidpreinitialize()Create the execution thread.- 
Methods inherited from class ptolemy.actor.TypedCompositeActor_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
 - 
Methods inherited from class ptolemy.actor.CompositeActor_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, clone, 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, 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, _exportMoMLContents, _removeEntity, _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_removePort, 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.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface ptolemy.actor.ActorcreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 - 
Methods inherited from interface ptolemy.kernel.util.DerivablegetDerivedLevel, getDerivedList, propagateValue
 - 
Methods inherited from interface ptolemy.actor.ExecutableisFireFunctional, isStrict, iterate, stop, stopFire, terminate
 - 
Methods inherited from interface ptolemy.actor.InitializableaddInitializable, initialize, removeInitializable, wrapup
 - 
Methods inherited from interface ptolemy.kernel.util.Nameabledescription, getContainer, getDisplayName, getFullName, getName, getName, setName
 
- 
 
- 
- 
- 
Constructor Detail- 
TMCompositeFacadepublic TMCompositeFacade(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException Construct an actor with the specified container and name. There is one parameter which is the full class name of a Ptolemy actor. This actor has no ports.- Parameters:
- container- The container.
- name- The name.
- Throws:
- IllegalActionException- If the actor cannot be contained by the proposed container.
- NameDuplicationException- If the name coincides with an actor already in the container.
 
 
- 
 - 
Method Detail- 
attributeChangedpublic void attributeChanged(Attribute attribute) throws IllegalActionException update local cache of executionTime.- Overrides:
- attributeChangedin class- TypedCompositeActor
- Parameters:
- attribute- The attribute that changed.
- Throws:
- IllegalActionException- Not thrown in this base class. Derived classes can throw this exception if type change is not allowed.
 
 - 
preinitializepublic void preinitialize() throws IllegalActionExceptionCreate the execution thread.- Specified by:
- preinitializein interface- Initializable
- Overrides:
- preinitializein class- CompositeActor
- Throws:
- IllegalActionException- If there is no director, or if the director's preinitialize() method throws it, or if this actor is not opaque.
 
 - 
prefirepublic boolean prefire() throws IllegalActionExceptionDescription copied from class:CompositeActorIf this actor is opaque, invoke the prefire() method of the local director. This method returns true if the actor is ready to fire (determined by the prefire() method of the director). It is read-synchronized on the workspace.- Specified by:
- prefirein interface- Executable
- Overrides:
- prefirein class- CompositeActor
- Returns:
- True if the iteration can proceed.
- Throws:
- IllegalActionException- If there is no director, or if the director's prefire() method throws it, or if this actor is not opaque.
 
 - 
firepublic void fire() throws IllegalActionExceptionDescription copied from class:CompositeActorIf this actor is opaque, transfer any data from the input ports of this composite to the ports connected on the inside, and then invoke the fire() method of its local director. The transfer is accomplished by calling the transferInputs() method of the local director (the exact behavior of which depends on the domain). If the actor is not opaque, throw an exception. This method is read-synchronized on the workspace, so the fire() method of the director need not be (assuming it is only called from here). After the fire() method of the director returns, send any output data created by calling the local director's transferOutputs method.- Specified by:
- firein interface- Executable
- Overrides:
- firein class- CompositeActor
- Throws:
- IllegalActionException- If there is no director, or if the director's fire() method throws it, or if the actor is not opaque.
 
 - 
postfirepublic boolean postfire() throws IllegalActionExceptionDescription copied from class:CompositeActorIf this actor is opaque, invoke the postfire() method of its local director and transfer output data. Specifically, transfer any data from the output ports of this composite to the ports connected on the outside. The transfer is accomplished by calling the transferOutputs() method of the executive director. If there is no executive director, then no transfer occurs. This method is read-synchronized on the workspace.- Specified by:
- postfirein interface- Executable
- Overrides:
- postfirein class- CompositeActor
- Returns:
- True if the execution can continue into the next iteration.
- Throws:
- IllegalActionException- If there is no director, or if the director's postfire() method throws it, or if this actor is not opaque.
 
 - 
_transferInputsprotected void _transferInputs() throws IllegalActionExceptionTransfer inputs from the ports.- Throws:
- IllegalActionException- If the director throws it while transferring inputs.
 
 - 
_transferOutputsprotected void _transferOutputs() throws IllegalActionExceptionTransfer outputs from the ports.- Throws:
- IllegalActionException- If the director throws it while transferring outputs
 
 - 
getExecutionTimepublic double getExecutionTime() Description copied from interface:TMActorReturn the execution time for this iteration. This method will be called by the TMDirector after the prefire() method is called. The reason for this method is to allow the actor to determine/estimate its execution time on a per iteration basis.- Specified by:
- getExecutionTimein interface- TMActor
- Returns:
- The execution time for this iteration.
 
 
- 
 
-