@Deprecated public class Timer extends DETransformer
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.
| Yellow (hyzheng) |
| Yellow (hyzheng) |
Entity.ContainedObjectsIterator| Modifier and Type | Field and 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.
|
input, output_typesValid_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
Timer(CompositeEntity container,
java.lang.String name)
Deprecated.
Construct an actor with the specified container and name.
|
| Modifier and Type | Method and 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.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_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_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_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, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListisFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminateaddInitializable, preinitialize, removeInitializable, wrapupdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic Parameter value
protected CausalityInterface _causalityInterface
protected double _delay
protected CalendarQueue _delayedOutputTokens
protected Token _currentInput
protected Token _currentOutput
public Timer(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container - The container.name - The name of this actor.IllegalActionException - If the entity cannot be contained
by the proposed container.NameDuplicationException - If the container already has an
actor with this name.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class TypedAtomicActorworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If a derived class has
has an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void declareDelayDependency()
throws IllegalActionException
declareDelayDependency in class AtomicActor<TypedIOPort>IllegalActionException - If the causality interface
cannot be computed.AtomicActor.getCausalityInterface()public void fire()
throws IllegalActionException
fire in interface Executablefire in class AtomicActor<TypedIOPort>IllegalActionException - If there is no director, or can not
send or get tokens from ports.public void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class AtomicActor<TypedIOPort>IllegalActionException - If a derived class throws it.public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class AtomicActor<TypedIOPort>IllegalActionException - If scheduling to refire cannot
be performed or the superclass throws it.