|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Source
ptolemy.actor.lib.TimedSource
ptolemy.actor.lib.Clock
ptolemy.domains.ct.lib.ContinuousClock
This is a clock source used in continuous time domain. It extends the clock actor in ptolemy/actor/lib directory but overrides the fire() method and postfire() method.
The actor uses the fireAt() method of the director to request firings at the beginning of each period plus each of the offsets, which are treated as breakpoints. At each breakpoint, the actor produces two outputs, one at t_minus phase and the other one at t_plus phase. The time does not advance at these two phases. For example, with the default settings, at time 1.0, the actor produces 0 at t_minus phase and 1 at t_plus phase. Note, at the breakpoint, we treat the output of this actor as any value between 0 and 1.
There is a defaultValue parameter which is used as output after the clock reachs the number of cycles. In the triggered continuous clock which extends this class, the defaultValue parameter is also used as output before the clock starts. The default value is 0.
The clock has a stopTime parameter and a numberOfCycles parameter. If the stopTime is a positive double, the whole model will stop execution when the stop time is reached. If the numberOfCycles is set to a positive integer, the clock will continue outputting the value of the defaultValue parameter after the number of cycles are reached.
Clock,
Serialized Form
| Red (hyzheng) |
| Red (hyzheng) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
ptolemy.kernel.Entity.ContainedObjectsIterator |
| Field Summary | |
ptolemy.data.expr.Parameter |
defaultValue
The default value used after the clock stops. |
| 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 | |
ContinuousClock(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Construct an actor with the specified container and name. |
|
| Method Summary | |
void |
fire()
Output the current value of the clock. |
void |
initialize()
Schedule the first firing and initialize local variables. |
boolean |
postfire()
Update the state of the actor and schedule the next firing, if appropriate. |
void |
preinitialize()
Make sure the continuous clock runs inside a CT domain. |
| Methods inherited from class ptolemy.actor.lib.Clock |
_getValue, _initializeCycleCount, _updateTentativeValues, 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 |
public ptolemy.data.expr.Parameter defaultValue
| Constructor Detail |
public ContinuousClock(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.NameDuplicationException,
ptolemy.kernel.util.IllegalActionException
container - The container.name - The name of this actor.
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 |
public void fire()
throws ptolemy.kernel.util.IllegalActionException
fire in interface ptolemy.actor.Executablefire in class Clockptolemy.kernel.util.IllegalActionException - If
the value in the offsets parameter is encountered that is greater
than the period, or if there is no director.
public void initialize()
throws ptolemy.kernel.util.IllegalActionException
initialize in interface ptolemy.actor.Executableinitialize in class Clockptolemy.kernel.util.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.
public void preinitialize()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the director is not
a CTDirector or the parent class throws it.
public boolean postfire()
throws ptolemy.kernel.util.IllegalActionException
postfire in interface ptolemy.actor.Executablepostfire in class Clockptolemy.kernel.util.IllegalActionException - If the director throws it when
scheduling the next firing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||