|
|||||||||
| 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.backtrack.automatic.ptolemy.actor.lib.BooleanSelect
public class BooleanSelect
A type polymorphic select with boolean valued control. In an iteration, if an input token is available at the control input, that token is read, and its value is noted. Its value specifies the input port that should be read next. If the control input is true, then if an input token is available on the trueInput port, then it is is read and sent to the output. Likewise with a false input and the falseInput port. The token sent to the output is determined by the control input, which must be a boolean value. Because tokens are immutable, the same Token is sent to the output, rather than a copy. The trueInput and falseInput port may receive Tokens of any type.
The actor indicates a willingness to fire in its prefire() method if there is an input available on the channel specified by the most recently seen token on the control port. If no token has ever been received on the control port, then falseInput is assumed to be the one to read.
This actor is similar to the BooleanMultiplexor actor, except that it never discards input tokens. Tokens on channels that are not selected are not consumed.
| Red (neuendor) |
| Green (neuendor) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
|---|
Entity.ContainedObjectsIterator |
| Field Summary | |
|---|---|
protected Checkpoint |
$CHECKPOINT
|
protected CheckpointRecord |
$RECORD$$CHECKPOINT
|
TypedIOPort |
control
Input that selects one of the other input ports. |
TypedIOPort |
falseInput
Input for tokens on the false path. |
TypedIOPort |
output
The output port. |
TypedIOPort |
trueInput
Input for tokens on the true path. |
| 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 | |
|---|---|
BooleanSelect(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 each input port. |
void |
initialize()
Initialize this actor so that the falseInput is read from until a token arrives on the control input. |
boolean |
prefire()
Return false if the control input channel does not have a token, or if the control input is true, the true input does not have a token, or if the control input is false, the false input does not have a token. |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
|---|
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList |
| Methods inherited from class ptolemy.actor.AtomicActor |
|---|
_actorFiring, _actorFiring, _createReceivers, addActorFiringListener, addInitializable, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, 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 |
|---|
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
|---|
isFireFunctional, isStrict, iterate, postfire, 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 TypedIOPort trueInput
public TypedIOPort falseInput
public TypedIOPort control
public TypedIOPort output
protected transient CheckpointRecord $RECORD$$CHECKPOINT
| Constructor Detail |
|---|
public BooleanSelect(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - The name of this actor within the container.
IllegalActionException - If the actor cannot be contained
by the proposed container.
NameDuplicationException - If the name coincides with
an actor already in the container.| Method Detail |
|---|
public void fire()
throws IllegalActionException
fire in interface Executablefire in class AtomicActorIllegalActionException - If there is no director.
public void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class AtomicActorIllegalActionException - If the parent class throws it.
public boolean prefire()
throws IllegalActionException
prefire in interface Executableprefire in class AtomicActorIllegalActionException - If there is no director.public void $COMMIT(long timestamp)
Rollbackable
$COMMIT in interface Rollbackabletimestamp - The timestamp.
public void $RESTORE(long timestamp,
boolean trim)
Rollbackable
$RESTORE in interface Rollbackabletimestamp - 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 Rollbackablepublic final java.lang.Object $SET$CHECKPOINT(Checkpoint checkpoint)
Rollbackable
$SET$CHECKPOINT in interface Rollbackablecheckpoint - The new checkpoint object.
Checkpoint.setCheckpoint(Checkpoint)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||