ptolemy.domains.de.lib
Class VariableDelay
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.de.kernel.DEActor
ptolemy.domains.de.lib.DETransformer
ptolemy.domains.de.lib.VariableDelay
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, SequenceActor, java.io.Serializable, TimedActor, TypedActor
- public class VariableDelay
- extends DETransformer
This actor works exactly as the ptolemy.domains.de.lib.TimedDelay actor,
except that the amount of time delayed is specified by an incoming
token through the delay port parameter.
- Since:
- Ptolemy II 1.0
- Version:
- $Id: VariableDelay.java,v 1.36.2.2 2004/06/20 03:10:44 cxh Exp $
- Author:
- Jie Liu, Haiyang Zheng
- See Also:
FunctionDependency,
TimedDelay,
Server,
SampleDelay,
Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Constructor Summary |
VariableDelay(CompositeEntity container,
java.lang.String name)
Construct an actor with the specified container and name.
|
|
Method Summary |
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Read one token from the input and save it so that the
postfire method can produce it to the output.
|
boolean |
postfire()
Produce token that was read in the fire() method, if there
was one.
|
void |
pruneDependencies()
Override the base class to declare that the output
does not depend on the input or delay ports
in a firing. |
| Methods inherited from class ptolemy.domains.de.kernel.DEActor |
newPort |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, prefire, preinitialize, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| 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.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 |
delay
public PortParameter delay
- The amount specifying delay.
VariableDelay
public VariableDelay(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the specified container and name.
Specify the IODependence attribute of the input and output ports.
- Parameters:
container - The composite actor to contain this one.name - The name of this actor.
- Throws:
IllegalActionException - If the entity cannot be contained
by the proposed container.
NameDuplicationException - If the container already has an
actor with this name.
clone
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
- Clone the actor into the specified workspace. This calls the
base class and then sets the parameter.
- Overrides:
clone in class AtomicActor
- Parameters:
workspace - The workspace for the new object.
- Returns:
- A new actor.
- Throws:
java.lang.CloneNotSupportedException - If a derived class has
has an attribute that cannot be cloned.
fire
public void fire()
throws IllegalActionException
- Read one token from the input and save it so that the
postfire method can produce it to the output.
Read one token from the delay input, if there is any.
Use the new delay for later input tokens.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If there is no director.
postfire
public boolean postfire()
throws IllegalActionException
- Produce token that was read in the fire() method, if there
was one.
The output is produced with a time offset equal to the value
of the delay parameter.
- 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 output
does not depend on the input or delay ports
in a firing.
- Overrides:
pruneDependencies in class AtomicActor
- See Also:
TimedDelay,
AtomicActor.removeDependency(IOPort, IOPort),
FunctionDependencyOfAtomicActor