|
|||||||||
| 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.BooleanSwitch
public class BooleanSwitch
A type polymorphic switch 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 input port, then it is is read and sent to the trueOutput. Likewise with a false input and the falseOutput port. Because tokens are immutable, the same Token is sent to the output, rather than a copy. The input port may receive Tokens of any type.
If no token has ever been received on the control port, then falseOutput is assumed to be the one to receive data.
Note that the this actor may be used in Synchronous Dataflow (SDF) models, but only under certain circumstances. The problem is that the number of tokens on the trueOutput or the falseOutput can change while the model is running, which makes static scheduling of the actor firings difficult.
| 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 |
falseOutput
Output for tokens on the false path. |
TypedIOPort |
input
The input port. |
TypedIOPort |
trueOutput
Output 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 | |
|---|---|
BooleanSwitch(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 falseOutput is written to until a token arrives on the control input. |
| 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, 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 |
|---|
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
|---|
isFireFunctional, isStrict, iterate, postfire, 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 TypedIOPort control
public TypedIOPort input
public TypedIOPort trueOutput
public TypedIOPort falseOutput
protected transient CheckpointRecord $RECORD$$CHECKPOINT
| Constructor Detail |
|---|
public BooleanSwitch(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 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 | ||||||||