Package ptolemy.domains.continuous.lib
Class EventSource
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity<T>
-
- ptolemy.actor.AtomicActor<TypedIOPort>
-
- ptolemy.actor.TypedAtomicActor
-
- ptolemy.domains.continuous.lib.EventSource
-
- All Implemented Interfaces:
java.lang.Cloneable,Actor,Executable,FiringsRecordable,Initializable,TypedActor,Changeable,Debuggable,DebugListener,Derivable,Instantiable,ModelErrorHandler,MoMLExportable,Moveable,Nameable
@Deprecated public class EventSource extends TypedAtomicActor
Deprecated.This actor outputs a set of events at a discrete set of time points. It can be used to generate impulses in Continuous models. Events are produced at superdense time index 1 or greater in order to ensure that the output is piecewise continuous.This actor only generates predictable events and that is why it does not implement the ContinuousStepSizeControlActor interface. This actor requests a refiring in its initialize() method to produce events. During its postfire() method, it requests further firings to produce more events if necessary.
- Since:
- Ptolemy II 6.0
- Version:
- $Id$
- Author:
- 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 ParameteroffsetsDeprecated.The offsets at which the specified values will be produced.TypedIOPortoutputDeprecated.The output port.ParameterperiodDeprecated.The period of the output events.ParametervaluesDeprecated.The values that will be produced at the specified offsets.-
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 EventSource(CompositeEntity container, java.lang.String name)Deprecated.Construct an actor in the specified container with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidattributeChanged(Attribute attribute)Deprecated.If the argument is the offsets parameter, check that the array is nondecreasing and has the right dimension; if the argument is period, check that it is positive.java.lang.Objectclone(Workspace workspace)Deprecated.Clone the actor into the specified workspace.voidfire()Deprecated.Emit the discrete event that happens at the current time.voidinitialize()Deprecated.Schedule the first firing and initialize local variables.booleanpostfire()Deprecated.Update the state of the actor and schedule the next firing, if the director is in the discrete phase.booleanprefire()Deprecated.Return true if this actor is scheduled to fire at the current time.-
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, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, 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, isStrict, iterate, 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
-
output
public TypedIOPort output
Deprecated.The output port. The type of this port is determined by from the values parameter.
-
offsets
public Parameter offsets
Deprecated.The offsets at which the specified values will be produced. This parameter must contain an array of doubles, and it defaults to {0.0, 1.0}.
-
period
public Parameter period
Deprecated.The period of the output events. This parameter must contain a DoubleToken, and defaults to 2.0.
-
values
public Parameter values
Deprecated.The values that will be produced at the specified offsets. This parameter must contain an ArrayToken, and defaults to {1, 0}.
-
-
Constructor Detail
-
EventSource
public EventSource(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Deprecated.Construct an actor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.- Parameters:
container- The container.name- The actor's name- Throws:
IllegalActionException- If the entity cannot be contained by the proposed container.NameDuplicationException- If name coincides with an entity already in the container.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
Deprecated.If the argument is the offsets parameter, check that the array is nondecreasing and has the right dimension; if the argument is period, check that it is positive. Other sanity checks with period and values are done in the fire() method.- Overrides:
attributeChangedin classNamedObj- Parameters:
attribute- The attribute that changed.- Throws:
IllegalActionException- If the offsets array is not nondecreasing and nonnegative, or it is not a row vector.
-
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 and then sets the parameter public members to refer to the parameters of the new actor.- Overrides:
clonein classTypedAtomicActor- Parameters:
workspace- The workspace for the new object.- Returns:
- A new actor.
- Throws:
java.lang.CloneNotSupportedException- If a derived class contains an attribute that cannot be cloned.- See Also:
NamedObj.exportMoML(Writer, int, String),NamedObj.setDeferringChangeRequests(boolean)
-
fire
public void fire() throws IllegalActionExceptionDeprecated.Emit the discrete event that happens at the current time. If there is no such events, do nothing.- Specified by:
firein interfaceExecutable- Overrides:
firein classAtomicActor<TypedIOPort>- Throws:
IllegalActionException- If the event cannot be sent.
-
initialize
public void initialize() throws IllegalActionExceptionDeprecated.Schedule the first firing and initialize local variables.- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAtomicActor<TypedIOPort>- Throws:
IllegalActionException- If the parent class throws it, or if the values parameter is not a row vector, or if the fireAt() method of the director throws it, or if the director does not agree to fire the actor at the specified time.
-
postfire
public boolean postfire() throws IllegalActionExceptionDeprecated.Update the state of the actor and schedule the next firing, if the director is in the discrete phase.- Specified by:
postfirein interfaceExecutable- Overrides:
postfirein classAtomicActor<TypedIOPort>- Returns:
- True if execution can continue into the next iteration.
- Throws:
IllegalActionException- If the director throws it when scheduling the next firing, or if the length of the values and offsets parameters don't match, or if the director does not agree to fire the actor at the specified time.
-
prefire
public boolean prefire() throws IllegalActionExceptionDeprecated.Return true if this actor is scheduled to fire at the current time.- Specified by:
prefirein interfaceExecutable- Overrides:
prefirein classAtomicActor<TypedIOPort>- Returns:
- True if this actor is scheduled to fire at the current time.
- Throws:
IllegalActionException- If thrown by the super class.
-
-