Package ptolemy.domains.sequence.lib
Class SequencedVariable
- 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.actor.lib.SetVariable
-
- ptolemy.domains.sequence.lib.SequencedSharedMemoryActor
-
- ptolemy.domains.sequence.lib.SequencedVariable
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,ExplicitChangeContext
,Changeable
,ChangeListener
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class SequencedVariable extends SequencedSharedMemoryActor
A variable that can share state across multiple instances and is used in the sequence domain.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Elizabeth Latronico
- Pt.AcceptedRating:
- Red (beth)
- Pt.ProposedRating:
- Red (beth)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description Parameter
copyVariableName
Delete this later when icon is figured out!!Parameter
outputInitialValue
A parameter to hold the output initial value.-
Fields inherited from class ptolemy.domains.sequence.lib.SequencedSharedMemoryActor
_scope, _sharedName, initialVariableName
-
Fields inherited from class ptolemy.actor.lib.SetVariable
delayed, input, output, variableName
-
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 SequencedVariable(CompositeEntity container, java.lang.String name)
Create a new SequencedVariable actor with the given name and container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Token
_getDefaultValue()
Supplies a default value for the variable, in the case that there is no initial value.void
fire()
Fire the actor.void
preinitialize()
In addition to the superclass preinitialize(), set the actor icon and its outputInitialValue.void
setName(java.lang.String name)
When the actor name is changed, update the referenced variables to point to the new parameters and check to see if these parameters exist.-
Methods inherited from class ptolemy.domains.sequence.lib.SequencedSharedMemoryActor
_setValue, _setValue, checkForAttributes, checkForAttributes, getInitialVariable, getInitialVariableName, getModifiedVariable, getModifiedVariable, getSharedName, getVariable, getVariableName
-
Methods inherited from class ptolemy.actor.lib.SetVariable
_customTypeConstraints, changeExecuted, changeFailed, clone, getContext, getModifiedVariables, postfire
-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _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, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, 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
-
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, initialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName
-
-
-
-
Field Detail
-
outputInitialValue
public Parameter outputInitialValue
A parameter to hold the output initial value. This parameter just copies the value in the initial value parameter. It is needed because its name depends on the output port. FIXME: In the future, upgrade to an interface with a function to do this.
-
copyVariableName
public Parameter copyVariableName
Delete this later when icon is figured out!!
-
-
Constructor Detail
-
SequencedVariable
public SequencedVariable(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Create a new SequencedVariable actor with the given name and container.- Parameters:
container
- The container that will contain the actor.name
- The name of the actor.- Throws:
NameDuplicationException
- Thrown if there is already an actor in the container with the same name.IllegalActionException
- Thrown if the actor cannot be instantiated.
-
-
Method Detail
-
fire
public void fire() throws IllegalActionException
Fire the actor. If the input is not connected, do not try to read a value from it. It is OK not to read any value, since messages always have an initial value.- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classSequencedSharedMemoryActor
- Throws:
IllegalActionException
- If the actor cannot be fired.
-
preinitialize
public void preinitialize() throws IllegalActionException
In addition to the superclass preinitialize(), set the actor icon and its outputInitialValue.- Specified by:
preinitialize
in interfaceInitializable
- Overrides:
preinitialize
in classSequencedSharedMemoryActor
- Throws:
IllegalActionException
- If the actor cannot be preinitialized.
-
setName
public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
When the actor name is changed, update the referenced variables to point to the new parameters and check to see if these parameters exist. This is also called when the actor is created, BEFORE the variables have been created in the constructor. So, we need to check for null variables here.- Specified by:
setName
in interfaceNameable
- Overrides:
setName
in classSequencedSharedMemoryActor
- Parameters:
name
- The new name for the actor.- Throws:
IllegalActionException
- Thrown if there is a problem setting the actor name.NameDuplicationException
- Thrown if the new name conflicts with the name of an existing actor in the container.- See Also:
NamedObj.getName()
,NamedObj.getName(NamedObj)
-
_getDefaultValue
protected Token _getDefaultValue() throws IllegalActionException
Supplies a default value for the variable, in the case that there is no initial value.- Overrides:
_getDefaultValue
in classSequencedSharedMemoryActor
- Returns:
- A token containing the default value
- Throws:
IllegalActionException
- Subclasses should throw an exception if an explicit initial value is required.
-
-