ptolemy.domains.ct.lib
Class TriggeredContinuousClock

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.actor.lib.Source
                              extended byptolemy.actor.lib.TimedSource
                                  extended byptolemy.actor.lib.Clock
                                      extended byptolemy.domains.ct.lib.ContinuousClock
                                          extended byptolemy.domains.ct.lib.TriggeredContinuousClock
All Implemented Interfaces:
ptolemy.actor.Actor, ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.actor.Executable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, java.io.Serializable, TimedActor, ptolemy.actor.TypedActor

public class TriggeredContinuousClock
extends ContinuousClock

This actor is an extension of ContinuousClock with a start and stop input. It is only used in CT domain. A token at the start input will start the clock. A token at the stop input will stop the clock, if it is still running. If both start and stop are received simultaneously, then the clock will be stopped.

This start and stop ports can are declared DISCRETE, and they should be connected to an event generator. Other domains ignore this declaration.

Since:
Ptolemy II 2.2
Version:
$Id: TriggeredContinuousClock.java,v 1.12 2004/04/13 03:27:34 cxh Exp $
Author:
Edward A. Lee, Haiyang Zheng
See Also:
ContinuousClock, Serialized Form
Accepted Rating:
Red (hyzheng)
Proposed Rating:
Red (hyzheng)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 ptolemy.actor.TypedIOPort start
          A port that, if connected, is used to specify when the clock starts.
 ptolemy.actor.TypedIOPort stop
          A port that, if connected, is used to specify when the clock stops.
 
Fields inherited from class ptolemy.domains.ct.lib.ContinuousClock
defaultValue
 
Fields inherited from class ptolemy.actor.lib.Clock
_currentValue, _cycleCount, _cycleStartTime, _done, _offsets, _phase, _startTime, _tentativeCurrentValue, _tentativeCycleCount, _tentativeCycleCountIncrement, _tentativeCycleStartTime, _tentativeDone, _tentativeNextFiringTime, _tentativePhase, _tentativeStartTime, numberOfCycles, offsets, period, values
 
Fields inherited from class ptolemy.actor.lib.TimedSource
stopTime
 
Fields inherited from class ptolemy.actor.lib.Source
output, trigger
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
TriggeredContinuousClock(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor with the specified container and name.
 
Method Summary
protected  void _initializeCycleCount()
          Initialize the cycle count and done flag.
protected  void _updateTentativeValues()
          Copy values committed in initialize() or in the last postfire() into the corresponding tentative variables.
 
Methods inherited from class ptolemy.domains.ct.lib.ContinuousClock
fire, initialize, postfire, preinitialize
 
Methods inherited from class ptolemy.actor.lib.Clock
_getValue, attributeChanged, clone, prefire
 
Methods inherited from class ptolemy.actor.lib.TimedSource
wrapup
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

start

public ptolemy.actor.TypedIOPort start
A port that, if connected, is used to specify when the clock starts. This port has undeclared type.


stop

public ptolemy.actor.TypedIOPort stop
A port that, if connected, is used to specify when the clock stops. This port has undeclared type.

Constructor Detail

TriggeredContinuousClock

public TriggeredContinuousClock(ptolemy.kernel.CompositeEntity container,
                                java.lang.String name)
                         throws ptolemy.kernel.util.NameDuplicationException,
                                ptolemy.kernel.util.IllegalActionException
Construct an actor with the specified container and name.

Parameters:
container - The container.
name - The name of this actor.
Throws:
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an actor with this name.
Method Detail

_initializeCycleCount

protected void _initializeCycleCount()
Initialize the cycle count and done flag. This overrides the base class to indicate that the clock is not running yet.

Overrides:
_initializeCycleCount in class Clock

_updateTentativeValues

protected void _updateTentativeValues()
                               throws ptolemy.kernel.util.IllegalActionException
Copy values committed in initialize() or in the last postfire() into the corresponding tentative variables. In effect, this loads the last known good value for these variables, which is particularly important if time has gone backwards. This overrides the base class to check whether the start or stop inputs have values.

Overrides:
_updateTentativeValues in class Clock
Throws:
ptolemy.kernel.util.IllegalActionException - If thrown accessing start or stop input data.