|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.Sink ptolemy.backtrack.automatic.ptolemy.actor.lib.Recorder
public class Recorder
Record all input tokens for later querying. This actor can be used for testing configurations of actors. It can also be used in programs that invoke Ptolemy models and wish to query the results after the model is run. The input tokens are read in the postfire() method so that in domains with fixed-point semantics, only the final, settled value is recorded. The current time is also recorded for each value.
The capacity parameter limits the size of the record. If the capacity is set to zero, then no tokens are recorded, but the total number of input tokens is counted. You can access the count via the getCount() method. If the capacity is 1, then only the most recently seen token on each channel is recorded. If the capacity is negative (the default), then the capacity is infinite.
Green (bilung) |
Green (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private static Token |
_bottom
|
private int |
_count
|
(package private) Token[] |
_latest
|
private java.util.List |
_records
|
private java.util.List |
_timeRecord
|
protected Checkpoint |
$CHECKPOINT
|
private FieldRecord |
$RECORD$_count
|
private FieldRecord |
$RECORD$_records
|
private FieldRecord |
$RECORD$_timeRecord
|
protected CheckpointRecord |
$RECORD$$CHECKPOINT
|
private FieldRecord[] |
$RECORDS
|
Parameter |
capacity
The capacity of the record for each channel. |
Fields inherited from class ptolemy.actor.lib.Sink |
---|
input |
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 | |
---|---|
Recorder(CompositeEntity container,
java.lang.String name)
Construct an actor with an input multiport that can accept any Token. |
Method Summary | |
---|---|
private int |
$ASSIGN$_count(int newValue)
|
private java.util.List |
$ASSIGN$_records(java.util.List newValue)
|
private java.util.List |
$ASSIGN$_timeRecord(java.util.List newValue)
|
private int |
$ASSIGN$SPECIAL$_count(int operator,
long newValue)
|
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. |
int |
getCount()
Get the total number of events seen so far. |
java.util.List |
getHistory(int channel)
Get the history for the specified channel number. |
Token |
getLatest(int channel)
Get the latest input for the specified channel. |
java.util.Enumeration |
getRecord(int channel)
Deprecated. This method is deprecated. Use getHistory(). |
java.util.List |
getTimeHistory()
Get the history of the time of each invocation of postfire(). |
java.util.Enumeration |
getTimeRecord()
Deprecated. This method is deprecated. Use getTimeHistory(). |
void |
initialize()
Initialize the lists used to record input data. |
boolean |
postfire()
Read at most one token from each input channel and record its value. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, clone, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, 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.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 |
---|
fire, 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 |
---|
protected transient Checkpoint $CHECKPOINT
public Parameter capacity
private int _count
private java.util.List _records
Token[] _latest
private java.util.List _timeRecord
private static Token _bottom
protected transient CheckpointRecord $RECORD$$CHECKPOINT
private transient FieldRecord $RECORD$_count
private transient FieldRecord $RECORD$_records
private transient FieldRecord $RECORD$_timeRecord
private transient FieldRecord[] $RECORDS
Constructor Detail |
---|
public Recorder(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the entity cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public int getCount()
public java.util.List getHistory(int channel)
channel
- The input channel for which the history is desired.
public Token getLatest(int channel)
channel
- The input channel for the record is desired.
public java.util.Enumeration getRecord(int channel)
channel
- The input channel for the record is desired.
public java.util.List getTimeHistory()
public java.util.Enumeration getTimeRecord()
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor
IllegalActionException
- If the parent class throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor
IllegalActionException
- If there is no director.private final int $ASSIGN$_count(int newValue)
private final int $ASSIGN$SPECIAL$_count(int operator, long newValue)
private final java.util.List $ASSIGN$_records(java.util.List newValue)
private final java.util.List $ASSIGN$_timeRecord(java.util.List newValue)
public void $COMMIT(long timestamp)
Rollbackable
$COMMIT
in interface Rollbackable
timestamp
- The timestamp.public void $RESTORE(long timestamp, boolean trim)
Rollbackable
$RESTORE
in interface Rollbackable
timestamp
- The timestamp taken at the time when the previous
state was recorded.trim
- Whether to delete the records used for the rollback.Checkpoint.rollback(long, boolean)
public final Checkpoint $GET$CHECKPOINT()
Rollbackable
$GET$CHECKPOINT
in interface Rollbackable
public final java.lang.Object $SET$CHECKPOINT(Checkpoint checkpoint)
Rollbackable
$SET$CHECKPOINT
in interface Rollbackable
checkpoint
- The new checkpoint object.
Checkpoint.setCheckpoint(Checkpoint)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |