|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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.domains.ct.lib.ThresholdMonitor
public class ThresholdMonitor
Output true if the input value is in the interval [a, b], which is centered at thresholdCenter and has width thresholdWidth. This actor controls the integration step size so that the input does not cross the threshold without producing at least one true output. The output can be used as a pure event to trigger other events or state transitions. When the input crosses the interval in one step, this actor will report that the integration step is not accurate and refines the new step size by bisecting the old step size.
Red (cxh) |
Red (liuj) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private boolean |
_accurate
|
private boolean |
_first
|
private double |
_lastInput
|
private double |
_lowerBound
|
private double |
_thCenter
|
private double |
_thisInput
|
private double |
_thWidth
|
private double |
_upperBound
|
TypedIOPort |
input
The input port, single port with type double. |
TypedIOPort |
output
The output port, single port with type boolean. |
Parameter |
thresholdCenter
The parameter for the center of the threshold. |
Parameter |
thresholdWidth
The parameter for the width of the threshold. |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _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 | |
---|---|
ThresholdMonitor(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified name. |
Method Summary | |
---|---|
void |
attributeChanged(Attribute attribute)
Update local caches if the attributes have been changed. |
void |
fire()
Consume the current input. |
void |
initialize()
Initialize the execution. |
boolean |
isOutputAccurate()
Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its output values. |
boolean |
isStateAccurate()
Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its current states. |
boolean |
postfire()
Make this input to be the history input and return true. |
double |
predictedStepSize()
Return java.lang.Double.MAX_VALUE, since this actor does not predict step sizes. |
double |
refinedStepSize()
Return half the current step size if the step crosses the threshold. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
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 |
---|
_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 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.actor.Executable |
---|
isFireFunctional, isStrict, iterate, prefire, 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 |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public TypedIOPort input
public TypedIOPort output
public Parameter thresholdWidth
public Parameter thresholdCenter
private double _thWidth
private double _thCenter
private boolean _first
private boolean _accurate
private double _upperBound
private double _lowerBound
private double _lastInput
private double _thisInput
Constructor Detail |
---|
public ThresholdMonitor(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The subsystem that this actor is lived inname
- The name of the actor.
IllegalActionException
- If the entity cannot be contained
by the proposed container.
NameDuplicationException
- If name coincides with
an entity already in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If there is no token in the
the attribute.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor
IllegalActionException
- If there is no director.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor
IllegalActionException
- If thrown by the super class.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor
IllegalActionException
- If token can not be read from or
sent to ports, or thrown by the super class.public double predictedStepSize()
predictedStepSize
in interface CTStepSizeControlActor
public double refinedStepSize()
refinedStepSize
in interface CTStepSizeControlActor
public boolean isStateAccurate()
CTStepSizeControlActor
isStateAccurate
in interface CTStepSizeControlActor
public boolean isOutputAccurate()
CTStepSizeControlActor
isOutputAccurate
in interface CTStepSizeControlActor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |