Package ptolemy.domains.de.lib
Class Timer
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,SequenceActor
,TimedActor
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
NonInterruptibleTimer
@Deprecated public class Timer extends DETransformer
Deprecated.Use VariableDelay instead, which is essentially identical, or ResettableTimer for a more reasonable timer behavior.A timer actor delays an event with a time delay specified by its input.When a timer actor receives an input, if the input value is bigger than 0.0, the timer schedules itself to fire again some time later to generate an output. The amount of delay is specified by the input value. The value of output is specified by the value parameter of this actor. If the input value is 0.0, an output is produced in the next firing with a bigger microstep. If the input is less than 0.0, an exception will be thrown.
This actor is different from the
NonInterruptibleTimer
actor because the NonInterruptibleTimer actor delays the processing of a new input if it has not finished processing a previous input, while the Timer actor begins processing inputs immediately upon their arrival.- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- Jie Liu, Edward A. Lee, Haiyang Zheng
- Pt.AcceptedRating:
- Yellow (hyzheng)
- Pt.ProposedRating:
- Yellow (hyzheng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected CausalityInterface
_causalityInterface
Deprecated.The causality interface, if it has been created.protected Token
_currentInput
Deprecated.Current input.protected Token
_currentOutput
Deprecated.Current output.protected double
_delay
Deprecated.The amount of delay.protected CalendarQueue
_delayedOutputTokens
Deprecated.A local queue to store the delayed tokens.Parameter
value
Deprecated.The value produced at the output.-
Fields inherited from class ptolemy.domains.de.lib.DETransformer
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 Timer(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 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 in a firing.void
fire()
Deprecated.Read one token from the input.void
initialize()
Deprecated.Initialize the internal states of this actor.boolean
postfire()
Deprecated.Update the internal states of this actor.-
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, isStrict, 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, attributeChanged, 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, isStrict, 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
-
value
public Parameter value
Deprecated.The value produced at the output. This can have any type, and it defaults to a boolean token with value true.
-
_causalityInterface
protected CausalityInterface _causalityInterface
Deprecated.The causality interface, if it has been created.
-
_delay
protected double _delay
Deprecated.The amount of delay.
-
_delayedOutputTokens
protected CalendarQueue _delayedOutputTokens
Deprecated.A local queue to store the delayed tokens.
-
_currentInput
protected Token _currentInput
Deprecated.Current input.
-
_currentOutput
protected Token _currentOutput
Deprecated.Current output.
-
-
Constructor Detail
-
Timer
public Timer(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Deprecated.Construct an actor with the specified container and name. Declare that the input can only receive double tokens and the output has a data type the same as the value parameter.- Parameters:
container
- The container.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
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Deprecated.Clone the actor into the specified workspace. This calls the base class, links the type of the value parameter to the output and sets the data type of the input to be double.- 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 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.Read one token from the input. Send out a token that is scheduled to produce at the current time to the output.- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If there is no director, or can not send or get tokens from ports.
-
initialize
public void initialize() throws IllegalActionException
Deprecated.Initialize the internal states of this actor.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If a derived class throws it.
-
postfire
public boolean postfire() throws IllegalActionException
Deprecated.Update the internal states of this actor. If the current input is not processed in the fire method, schedule a refiring of this actor to produce an output in a future time, (the current model time + delay specified by the input value).- 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.
-
-