|
||||||||||
| 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.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.actor.lib.hoc.LifeCycleManager
ptolemy.domains.wireless.lib.TransmitPropertyTransformer
This actor reads input tokens and sends them unmodified to the output; its role is not to operate on input tokens, but rather to modify the properties of a transmission.
This actor implements the PropertyTransformer interface, which provides a callback that can be use to modify the transmit properties of a transmission. It register itself and its connected wireless output port with the channel that the wireless output port uses. The channel will call its transformProperties() method for each transmission from the registed output port.
When transformProperties() is called, this actor sets the value of three variables and then performs a complete execution of the contained model. The three variables are senderLocation (an array of doubles), receiverLocation (also an array of doubles), and properties (a record token containing the transmit properties to be modified). After execution of the contained model, the (possibly modified) value of the record properties is taken to be the modified properties. Thus, a contained model would normally read the variable properties, change it, and use a SetVariable actor to set the new value of properties.
This actor expects its output port to be connected directly to the inside of a WirelessIOPort belonging to this actor's container. It looks for this port in the preinitialize() method, and registers with the channel specified by that port. If there is no such port, or no such channel, then preinitialize() throws an exception. Note that since this connectivity is checked only during preinitialize(), this actor does not support dynamically reconnecting its output port during execution of the model.
| Red (pjb2e) |
| Yellow (eal) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.CompositeEntity |
ptolemy.kernel.CompositeEntity.ContainedObjectsIterator |
| Field Summary | |
ptolemy.actor.TypedIOPort |
input
Port that receives the data to be transmitted on the output port. |
ptolemy.actor.TypedIOPort |
output
Port that sends data to a wireless output. |
ptolemy.data.expr.Parameter |
properties
The properties to be transformed. |
ptolemy.data.expr.Parameter |
receiverLocation
The location of the receiver. |
ptolemy.data.expr.Parameter |
senderLocation
The location of the sender. |
| Fields inherited from class ptolemy.actor.CompositeActor |
_stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
TransmitPropertyTransformer(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Construct an actor with the specified container and name. |
|
| Method Summary | |
protected void |
_readInputs()
Override the base class to not read any inputs. |
protected void |
_writeOutputs()
Override the base class to not write any outputs. |
java.lang.Object |
clone(ptolemy.kernel.util.Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Read at most one token from the input port and simply transmit the data to the output port. |
boolean |
postfire()
Return true, indicating that execution can continue. |
boolean |
prefire()
Return true, indicating that this actor is always ready to fire. |
void |
preinitialize()
Register with the channel as a PropertyTransformer for its connected wireless output port. |
ptolemy.data.RecordToken |
transformProperties(ptolemy.data.RecordToken initialProperties,
WirelessIOPort sender,
WirelessIOPort destination)
Set the senderLocation, receiverLocation, and properties variables and execute the contained model. |
void |
wrapup()
Override the base class to unregister this actor with the channel. |
| Methods inherited from class ptolemy.actor.lib.hoc.LifeCycleManager |
_executeInsideModel, executeChangeRequests, isOpaque, requestChange |
| Methods inherited from class ptolemy.actor.TypedCompositeActor |
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _typeConstraintsFromTo, newPort, newRelation, resolveTypes, typeConstraintList |
| Methods inherited from class ptolemy.actor.CompositeActor |
_finishedAddEntity, _setDirector, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newInsideReceiver, newReceiver, outputPortList, setContainer, setDirector, setManager, stop, stopFire, terminate |
| Methods inherited from class ptolemy.kernel.CompositeEntity |
_adjustDeferrals, _description, _exportMoMLContents, _removeEntity, _removeRelation, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, entityList, entityList, exportLinks, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, numberOfClassDefinitions, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, deepContains, depthInHierarchy, description, description, event, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace |
| 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 |
initialize, iterate, stop, stopFire, terminate |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
getDerivedLevel, getDerivedList, propagateValue |
| Methods inherited from interface ptolemy.kernel.util.Nameable |
description, getFullName, getName, getName |
| Field Detail |
public ptolemy.actor.TypedIOPort input
public ptolemy.actor.TypedIOPort output
public ptolemy.data.expr.Parameter senderLocation
public ptolemy.data.expr.Parameter receiverLocation
public ptolemy.data.expr.Parameter properties
| Constructor Detail |
public TransmitPropertyTransformer(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.NameDuplicationException,
ptolemy.kernel.util.IllegalActionException
container - The container.name - The name.
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained
by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an
actor with this name.| Method Detail |
public java.lang.Object clone(ptolemy.kernel.util.Workspace workspace)
throws java.lang.CloneNotSupportedException
workspace - The workspace for the new object.
java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.
public void fire()
throws ptolemy.kernel.util.IllegalActionException
fire in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If there is no director, or if
the director's action methods throw it.
public boolean postfire()
throws ptolemy.kernel.util.IllegalActionException
postfire in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - Not thrown in this class,
but declared so the subclasses can throw it.
public boolean prefire()
throws ptolemy.kernel.util.IllegalActionException
prefire in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - Not thrown in this class,
but declared so the subclasses can throw it.
public void preinitialize()
throws ptolemy.kernel.util.IllegalActionException
preinitialize in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If the output is not
connected directly to a WirelessIOPort, or if the port's
container does not have a container, or if no channel is
found.
public ptolemy.data.RecordToken transformProperties(ptolemy.data.RecordToken initialProperties,
WirelessIOPort sender,
WirelessIOPort destination)
throws ptolemy.kernel.util.IllegalActionException
transformProperties in interface PropertyTransformerinitialProperties - The initial value of the properties.sender - The sending port.destination - The receiving port.
ptolemy.kernel.util.IllegalActionException - If executing the model
throws it.
public void wrapup()
throws ptolemy.kernel.util.IllegalActionException
wrapup in interface ptolemy.actor.Executableptolemy.kernel.util.IllegalActionException - If the base class throws it.protected void _readInputs()
protected void _writeOutputs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||