|
||||||||||
| 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.Transformer
ptolemy.domains.ct.lib.LevelCrossingDetector
An event detector that converts continuous signals to discrete events when the continuous signal crosses a level threshold.
When the trigger equals to the level threshold (within the specified errorTolerance), this actor outputs a discrete event with the value as defaultEventValue if useEventValue is selected. Otherwise, the actor outputs a discrete event with the value as the level threshold. This actor controls the integration step size to accurately resolve the time at which the level crossing occurs. So, this actor is only used in Continuous Time domain.
| Red (cxh) |
| Yellow (liuj) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
ptolemy.kernel.Entity.ContainedObjectsIterator |
| Field Summary | |
protected double |
_level
|
ptolemy.data.expr.Parameter |
defaultEventValue
The parameter that specifies the default output event value if the input port is not connected to any thing. |
ptolemy.data.expr.Parameter |
errorTolerance
The parameter of error tolerance of type double. |
ptolemy.data.expr.Parameter |
level
The parameter that specifies the level threshold. |
ptolemy.actor.TypedIOPort |
trigger
The trigger port. |
ptolemy.data.expr.Parameter |
useEventValue
The parameter that indicates whether to use the default event value. |
| Fields inherited from class ptolemy.actor.lib.Transformer |
input, output |
| 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 | |
LevelCrossingDetector(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified name. |
|
| Method Summary | |
void |
attributeChanged(ptolemy.kernel.util.Attribute attribute)
Update the attribute if it has been changed. |
java.lang.Object |
clone(ptolemy.kernel.util.Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Consume the trigger token. |
boolean |
hasCurrentEvent()
Return true if there is an event at the current time. |
void |
initialize()
Initialize the execution. |
boolean |
isThisStepAccurate()
Return true if this step does not cross the threshold. |
boolean |
postfire()
Prepare for the next iteration, by making the current trigger token to be the history trigger token. |
double |
predictedStepSize()
Return the maximum Double, since this actor does not predict step size. |
boolean |
prefire()
If the level has changed during the last iteration, update the parameter value. |
void |
preinitialize()
Make sure the actor runs inside a CT domain. |
double |
refinedStepSize()
Return the refined step size if there is a missed event, otherwise return the current step size. |
| 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, wrapup |
| 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, wrapup |
| 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.actor.TypedIOPort trigger
public ptolemy.data.expr.Parameter errorTolerance
public ptolemy.data.expr.Parameter level
public ptolemy.data.expr.Parameter defaultEventValue
public ptolemy.data.expr.Parameter useEventValue
protected double _level
| Constructor Detail |
public LevelCrossingDetector(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.IllegalActionException,
ptolemy.kernel.util.NameDuplicationException
container - The subsystem that this actor is lived inname - The actor's name
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained
by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If name coincides with
an entity already in the container.| Method Detail |
public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
throws ptolemy.kernel.util.IllegalActionException
attribute - The attribute that has changed.
ptolemy.kernel.util.IllegalActionException - If the attribute change failed.
public java.lang.Object clone(ptolemy.kernel.util.Workspace workspace)
throws java.lang.CloneNotSupportedException
workspace - The workspace for the new object.
java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.
public void fire()
throws ptolemy.kernel.util.IllegalActionException
fire in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If no token is available.public boolean hasCurrentEvent()
hasCurrentEvent in interface CTEventGenerator
public void initialize()
throws ptolemy.kernel.util.IllegalActionException
initialize in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If thrown by the super class.public boolean isThisStepAccurate()
isThisStepAccurate in interface CTStepSizeControlActorpublic boolean postfire()
postfire in interface ptolemy.actor.Executablepublic double predictedStepSize()
predictedStepSize in interface CTStepSizeControlActor
public boolean prefire()
throws ptolemy.kernel.util.IllegalActionException
prefire in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If the getToken() method
of the level parameter throws it.
public void preinitialize()
throws ptolemy.kernel.util.IllegalActionException
preinitialize in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If the director is not
a CTDirector or the parent class throws it.public double refinedStepSize()
refinedStepSize in interface CTStepSizeControlActor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||