ptolemy.domains.pn.kernel
Class NondeterministicMerge
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.pn.kernel.NondeterministicMerge
- 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 NondeterministicMerge
- extends TypedCompositeActor
This actor takes any number of input streams and merges them
nondeterministically. This actor is intended for use in the
PN domain. It is a composite actor that
creates its own contents. It contains an instance of PNDirector and one
actor for each input channel (it creates these actors automatically
when a connection is created to the input multiport). The contained
actors are special actors (implemented as an instance of an inner class)
that read from the port of this actor and write to the port of
this actor. They have no ports of their own. The lifecycle of the
contained actors (when they are started or stopped) is handled by
the PNDirector in the usual way.
- Since:
- Ptolemy II 4.1
- Version:
- $Id: NondeterministicMerge.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Edward A. Lee, Haibo Zeng
- 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 |
Method Summary |
private void |
_constructor()
Construct a NondeterministicMerge. |
private void |
_reinitializeInnerActors()
Create the contained actors to handle the inputs. |
void |
connectionsChanged(Port port)
Override the base class to adjust the number of contained
actors, if the number is no longer correct. |
void |
initialize()
Initialize this actor. |
Methods inherited from class ptolemy.actor.CompositeActor |
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, clone, createReceivers, createSchedule, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, 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.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 |
input
public TypedIOPort input
- The input port. This base class imposes no type constraints except
that the type of the input cannot be greater than the type of the
output.
output
public TypedIOPort output
- The output port. By default, the type of this output is constrained
to be at least that of the input.
channel
public TypedIOPort channel
- Output port used to indicate which input channel the current
output came from. This has type int.
NondeterministicMerge
public NondeterministicMerge(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor in the specified container with the specified
name. Create ports and make the input port a multiport.
- Parameters:
container
- The container.name
- The name.
- Throws:
NameDuplicationException
- If an actor
with an identical name already exists in the container.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NondeterministicMerge
public NondeterministicMerge(Workspace workspace)
throws NameDuplicationException,
IllegalActionException
- Construct a TypedCompositeActor 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. You should set the local director or
executive director before attempting to send data to the actor
or to execute it. Add the actor to the workspace directory.
Increment the version number of the workspace.
- Parameters:
workspace
- The workspace that will list the actor.
- Throws:
NameDuplicationException
- If an actor
with an identical name already exists in the container.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
connectionsChanged
public void connectionsChanged(Port port)
- Override the base class to adjust the number of contained
actors, if the number is no longer correct.
- Overrides:
connectionsChanged
in class CompositeActor
- Parameters:
port
- The port that has connection changes.
initialize
public void initialize()
throws IllegalActionException
- Initialize this actor.
- Specified by:
initialize
in interface Initializable
- Overrides:
initialize
in class CompositeActor
- Throws:
IllegalActionException
- If the parent class throws it.
_constructor
private void _constructor()
throws NameDuplicationException,
IllegalActionException
- Construct a NondeterministicMerge.
- Throws:
NameDuplicationException
IllegalActionException
_reinitializeInnerActors
private void _reinitializeInnerActors()
- Create the contained actors to handle the inputs.