ptolemy.domains.ptera.kernel
Class PteraModalModel

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.kernel.CompositeEntity
                      extended by ptolemy.actor.CompositeActor
                          extended by ptolemy.actor.TypedCompositeActor
                              extended by ptolemy.domains.modal.modal.ModalModel
                                  extended by ptolemy.domains.ptera.kernel.PteraModalModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, ChangeListener, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class PteraModalModel
extends ModalModel

This is a typed composite actor to be a Ptera modal model. A Ptera modal model has a Ptera (Ptolemy Event Relation Actor) model inside. The Ptera model has a number of events, and scheduling relations may exist between events, meaning that the processing of the starting event causes the ending event to occur after a certain amount of model time. A scheduling relation may also be guarded by a Boolean expression.

The controller of a Ptera modal model is a Ptera controller (instance of PteraController). The Ptera controller contains an PteraDirector, which has an event queue to store scheduled events in time-stamp order. The Ptera modal model itself also has a Ptera director. The Ptera director in the controller maintains its own event queue, and schedules itself to be fired by putting the controller in the event queue of the Ptera modal model's director.

An event can have one or more refinements. A refinement can be an actor model, an FSM model, or a Ptera model. If a refinement is a Ptera model, then its controller reports its earliest event to the controller of this modal model, which fires it when the model time reaches the reported time in the future. If the Ptera refinement itself contains an event that has a refinement in Ptera, that controller reports to the controller one level above, which in turn reports to the modal model.

Since:
Ptolemy II 8.0
Version:
$Id: PteraModalModel.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.domains.modal.modal.ModalModel
_controller, directorClass, stateDependentCausality
 
Fields inherited from class ptolemy.actor.CompositeActor
_actorFiringListeners, _causalityInterface, _initializables, _notifyingActorFiring, _publishedPorts, _publisherRelations, _stopRequested
 
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
 
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
PteraModalModel(CompositeEntity container, java.lang.String name)
          Construct a Ptera modal model with a name and a container.
PteraModalModel(Workspace workspace)
          Construct a Ptera modal model in the specified workspace with no container and an empty string as a name.
 
Method Summary
protected  PteraController _createController()
          Create a Ptera controller within this Ptera modal model.
private  void _init()
          Initialize the Ptera modal model by creating the parameter directorClass and a Ptera controller inside.
 CausalityInterface getCausalityInterface()
          Return a causality interface for this actor.
 
Methods inherited from class ptolemy.domains.modal.modal.ModalModel
attributeChanged, changeExecuted, changeFailed, clone, getController, newPort
 
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _typeConstraintsFromTo, newRelation, resolveTypes, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, fire, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, 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.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, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, 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
 
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, 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
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Constructor Detail

PteraModalModel

public PteraModalModel(CompositeEntity container,
                       java.lang.String name)
                throws IllegalActionException,
                       NameDuplicationException
Construct a Ptera modal model with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.

Parameters:
container - The container.
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.

PteraModalModel

public PteraModalModel(Workspace workspace)
                throws IllegalActionException,
                       NameDuplicationException
Construct a Ptera modal model 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 name has a period in it, or the director is not compatible with the specified container.
NameDuplicationException - If the container already contains an entity with the specified name.
Method Detail

getCausalityInterface

public CausalityInterface getCausalityInterface()
Return a causality interface for this actor. This method returns the causality interface where no output port depends on the input ports. It is an instance of BreakCausalityInterface. FIXME: A causality interface special for Ptera should be returned instead.

Specified by:
getCausalityInterface in interface Actor
Overrides:
getCausalityInterface in class ModalModel
Returns:
A representation of the dependencies between input ports and output ports.

_createController

protected PteraController _createController()
                                     throws IllegalActionException,
                                            NameDuplicationException
Create a Ptera controller within this Ptera modal model. A subclass may return a different controller to be used in this Ptera modal model.

Returns:
A controller to be used in this modal model.
Throws:
IllegalActionException - If the Ptera modal model is incompatible with the controller.
NameDuplicationException - If the name of the controller collides with a name already in the container.

_init

private void _init()
            throws IllegalActionException,
                   NameDuplicationException
Initialize the Ptera modal model by creating the parameter directorClass and a Ptera controller inside.

Throws:
IllegalActionException - If the Ptera modal model is incompatible with the controller.
NameDuplicationException - If the name of the controller collides with a name already in the container.