ptolemy.domains.sr.lib
Class InstantaneousDialogGenerator

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.sr.lib.InstantaneousDialogGenerator
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor

public class InstantaneousDialogGenerator
extends TypedAtomicActor

An actor that generates instantaneous dialog with a LookupTable. This actor outputs incrementing integers on the indexOutput port. A server is expected to receive an index number and output a token associated with this index, which the client receives on the dataInput port. The client then outputs this token on the dataOutput port. All ports are single ports.

Since:
Ptolemy II 2.0
Version:
$Id: InstantaneousDialogGenerator.java,v 1.16.2.1 2004/06/20 03:10:45 cxh Exp $
Author:
Paul Whitaker
See Also:
Serialized Form
Accepted Rating:
Red (pwhitake)
Proposed Rating:
Red (pwhitake)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 TypedIOPort dataInput
          Input port for data from a server.
 TypedIOPort dataOutput
          Output port for data.
 TypedIOPort indexOutput
          Output port for data indices.
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
InstantaneousDialogGenerator(CompositeEntity container, java.lang.String name)
          Construct an actor in the specified container with the specified name.
 
Method Summary
 void fire()
          Output incrementing integers on the inputOutput.
 void initialize()
          Initialize private variables.
 boolean postfire()
          Increment the index number.
 void pruneDependencies()
          Override the base class to declare that the dataOutput and indexOutput ports do not depend on the dataInput port in a firing.
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, prefire, preinitialize, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

dataInput

public TypedIOPort dataInput
Input port for data from a server.


dataOutput

public TypedIOPort dataOutput
Output port for data. The type is the same as dataInput.


indexOutput

public TypedIOPort indexOutput
Output port for data indices. The type is integer.

Constructor Detail

InstantaneousDialogGenerator

public InstantaneousDialogGenerator(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 adder 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.
Method Detail

fire

public void fire()
          throws IllegalActionException
Output incrementing integers on the inputOutput. Transfer tokens received on the dataInput port to the dataOutput port.

Specified by:
fire in interface Executable
Overrides:
fire in class AtomicActor
Throws:
IllegalActionException - If there is no director.

initialize

public void initialize()
                throws IllegalActionException
Initialize private variables.

Specified by:
initialize in interface Executable
Overrides:
initialize in class AtomicActor
Throws:
IllegalActionException - If there is no director.

postfire

public boolean postfire()
                 throws IllegalActionException
Increment the index number.

Specified by:
postfire in interface Executable
Overrides:
postfire in class AtomicActor
Returns:
True if execution can continue into the next iteration.
Throws:
IllegalActionException - If there is no director.

pruneDependencies

public void pruneDependencies()
Override the base class to declare that the dataOutput and indexOutput ports do not depend on the dataInput port in a firing.

Overrides:
pruneDependencies in class AtomicActor
See Also:
TimedDelay, AtomicActor.removeDependency(IOPort, IOPort), FunctionDependencyOfAtomicActor