ptolemy.backtrack.automatic.ptolemy.actor.lib
Class DB
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Transformer
ptolemy.backtrack.automatic.ptolemy.actor.lib.DB
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Rollbackable, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class DB
- extends Transformer
- implements Rollbackable
Produce a token that is the value of the input in decibels.
That is, if the input is z, then the output is
k*log10(z).
The constant k depends on the value of the inputIsPower
parameter. If that parameter is true, then k = 10.
Otherwise (the default) k = 20.
Normally, you would set inputIsPower to true if
the input is the square of a signal, and to false otherwise.
The output is never smaller than the value of the min parameter.
This makes it easier to plot by limiting the range of output values.
If the input is zero or negative, then the output is the
value of the min parameter.
The input and output both have type double.
- Since:
- Ptolemy II 1.0
- Version:
- $Id: DB.java,v 1.26 2005/10/28 20:14:39 cxh Exp $
- Author:
- Bart Kienhuis and Edward A. Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Constructor Summary |
DB(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified
name. |
|
Method Summary |
void |
$COMMIT(long timestamp)
Commit changes up to the given timestamp, but not including changes
made at timestamp and afterward. |
Checkpoint |
$GET$CHECKPOINT()
Get the checkpoint object that monitors this rollbackable object. |
void |
$RESTORE(long timestamp,
boolean trim)
Restore a previous state to all the private fields of this rollbackable
object. |
java.lang.Object |
$SET$CHECKPOINT(Checkpoint checkpoint)
Set the checkpoint object of this rollbackable object. |
void |
fire()
Read a token from the input and convert its value into a
decibel representation. |
int |
iterate(int count)
Invoke a specified number of iterations of this actor. |
| Methods inherited from class ptolemy.actor.AtomicActor |
_actorFiring, _actorFiring, _createReceivers, addActorFiringListener, addInitializable, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, isFireFunctional, isStrict, newReceiver, outputPortList, postfire, prefire, preinitialize, 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, 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.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, 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 |
$CHECKPOINT
protected transient Checkpoint $CHECKPOINT
inputIsPower
public Parameter inputIsPower
- If the input is proportional to power, then set this to true.
This must be a boolean, and defaults to false.
min
public Parameter min
- The minimum value of the output. This is a double,
and defaults to -100.0.
$RECORD$$CHECKPOINT
protected transient CheckpointRecord $RECORD$$CHECKPOINT
DB
public DB(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct an actor in the specified container with the specified
name.
- Parameters:
container - The container.name - The name of this actor within the container.
- Throws:
IllegalActionException - If the actor cannot be contained
by the proposed container.
NameDuplicationException - If the name coincides with
an actor already in the container.
fire
public void fire()
throws IllegalActionException
- Read a token from the input and convert its value into a
decibel representation. If the input does not contain any tokens,
do nothing.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If there is no director.
iterate
public int iterate(int count)
throws IllegalActionException
- Invoke a specified number of iterations of this actor. Each
iteration converts a single token to decibels. An invocation
of this method therefore applies the conversion to count
successive input tokens.
This method should be called instead of the usual prefire(),
fire(), postfire() methods when this actor is used in a
domain that supports vectorized actors. This leads to more
efficient execution.
- Specified by:
iterate in interface Executable- Overrides:
iterate in class AtomicActor
- Parameters:
count - The number of iterations to perform.
- Returns:
- COMPLETED if the actor was successfully iterated the
specified number of times. Otherwise, return NOT_READY, and do
not consume any input tokens.
- Throws:
IllegalActionException - If iterating cannot be
performed.
$COMMIT
public void $COMMIT(long timestamp)
- Description copied from interface:
Rollbackable
- Commit changes up to the given timestamp, but not including changes
made at timestamp and afterward.
- Specified by:
$COMMIT in interface Rollbackable
- Parameters:
timestamp - The timestamp.
$RESTORE
public void $RESTORE(long timestamp,
boolean trim)
- Description copied from interface:
Rollbackable
- Restore a previous state to all the private fields of this rollbackable
object.
- Specified by:
$RESTORE in interface Rollbackable
- Parameters:
timestamp - The timestamp taken at the time when the previous
state was recorded.trim - Whether to delete the records used for the rollback.- See Also:
Checkpoint.rollback(long, boolean)
$GET$CHECKPOINT
public final Checkpoint $GET$CHECKPOINT()
- Description copied from interface:
Rollbackable
- Get the checkpoint object that monitors this rollbackable object.
- Specified by:
$GET$CHECKPOINT in interface Rollbackable
- Returns:
- The checkpoint object.
$SET$CHECKPOINT
public final java.lang.Object $SET$CHECKPOINT(Checkpoint checkpoint)
- Description copied from interface:
Rollbackable
- Set the checkpoint object of this rollbackable object. A merge
operation is performed on the current checkpoint object and the new
checkpoint object, so that the two checkpoint objects monitor the same
set of objects when this function returns.
- Specified by:
$SET$CHECKPOINT in interface Rollbackable
- Parameters:
checkpoint - The new checkpoint object.
- Returns:
- This rollbackable object itself.
- See Also:
Checkpoint.setCheckpoint(Checkpoint)