Package ptolemy.domains.de.lib
Class VariableDelay
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
@Deprecated public class VariableDelay extends Transformer
Deprecated.Use ptolemy.actor.lib.TimeDelay.This actor delays its inputs by a variable delay. It works in a similar way as the TimedDelay actor except that the amount of time delayed is specified by an incoming token through the delay port (a parameter port). If the delay is zero, then this actor only increments the microstep, not the model time. If a negative delay is specified, then an exception is thrown.- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- Jie Liu, Haiyang Zheng
- See Also:
TimedDelay
- Pt.AcceptedRating:
- Yellow (hyzheng)
- Pt.ProposedRating:
- Green (hyzheng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected Token
_currentOutput
Deprecated.Current output.protected double
_delay
Deprecated.The amount of delay.protected CalendarQueue
_delayedOutputTokens
Deprecated.A local event queue to store the delayed output tokens.PortParameter
delay
Deprecated.The amount specifying delay.-
Fields inherited from class ptolemy.actor.lib.Transformer
input, output
-
Fields inherited from class ptolemy.actor.TypedAtomicActor
_typesValid
-
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
-
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.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description VariableDelay(CompositeEntity container, java.lang.String name)
Deprecated.Construct an actor with the specified container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
attributeChanged(Attribute attribute)
Deprecated.If the attribute is delay, then ensure that the value is non-negative.java.lang.Object
clone(Workspace workspace)
Deprecated.Clone the actor into the specified workspace.void
declareDelayDependency()
Deprecated.Declare that the output does not depend on the input and delay in a firing.void
fire()
Deprecated.Update the delay parameter from the delay port and ensure the delay is not negative.void
initialize()
Deprecated.Initialize the states of this actor.boolean
isStrict()
Deprecated.Return false indicating that this actor can be fired even if the inputs are unknown.boolean
postfire()
Deprecated.Process the current input if it has not been processed.-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, 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, requestChange, 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, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, iterate, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Field Detail
-
delay
public PortParameter delay
Deprecated.The amount specifying delay. Its default value is 1.0.
-
_currentOutput
protected Token _currentOutput
Deprecated.Current output.
-
_delay
protected double _delay
Deprecated.The amount of delay.
-
_delayedOutputTokens
protected CalendarQueue _delayedOutputTokens
Deprecated.A local event queue to store the delayed output tokens.
-
-
Constructor Detail
-
VariableDelay
public VariableDelay(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Deprecated.Construct an actor with the specified container and name.- Parameters:
container
- The composite entity 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.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
Deprecated.If the attribute is delay, then ensure that the value is non-negative.NOTE: the newDelay may be 0.0, which may change the causality property of the model. We leave the model designers to decide whether the zero delay is really what they want.
- Overrides:
attributeChanged
in classNamedObj
- Parameters:
attribute
- The attribute that changed.- Throws:
IllegalActionException
- If the delay is negative.
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Deprecated.Clone the actor into the specified workspace. Set a type constraint that the output type is the same as the that of input.- Overrides:
clone
in classTypedAtomicActor
- 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.- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
declareDelayDependency
public void declareDelayDependency() throws IllegalActionException
Deprecated.Declare that the output does not depend on the input and delay in a firing.- Overrides:
declareDelayDependency
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If the causality interface cannot be computed.- See Also:
AtomicActor.getCausalityInterface()
-
fire
public void fire() throws IllegalActionException
Deprecated.Update the delay parameter from the delay port and ensure the delay is not negative. Call the fire method of super class to consume inputs and generate outputs.- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If the super class throws it, or a negative delay is received.
-
initialize
public void initialize() throws IllegalActionException
Deprecated.Initialize the states of this actor.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If a derived class throws it.
-
isStrict
public boolean isStrict()
Deprecated.Return false indicating that this actor can be fired even if the inputs are unknown.- Specified by:
isStrict
in interfaceExecutable
- Overrides:
isStrict
in classAtomicActor<TypedIOPort>
- Returns:
- False.
-
postfire
public boolean postfire() throws IllegalActionException
Deprecated.Process the current input if it has not been processed. Schedule a firing to produce the earliest output token.- Specified by:
postfire
in interfaceExecutable
- Overrides:
postfire
in classAtomicActor<TypedIOPort>
- Returns:
- True if execution can continue into the next iteration.
- Throws:
IllegalActionException
- If scheduling to refire cannot be performed or the superclass throws it.
-
-