Class TransmitPropertyTransformer

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, PropertyTransformer, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class TransmitPropertyTransformer
    extends LifeCycleManager
    implements PropertyTransformer
    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 registered 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.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Yang Zhao, Edward Lee
    Pt.AcceptedRating:
    Red (pjb2e)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • input

        public TypedIOPort input
        Port that receives the data to be transmitted on the output port. The type is unconstrained.
      • output

        public TypedIOPort output
        Port that sends data to a wireless output. The type is constrained to be the same as the input.
      • senderLocation

        public Parameter senderLocation
        The location of the sender. This is a double array with default value {0.0, 0.0}.
      • receiverLocation

        public Parameter receiverLocation
        The location of the receiver. This is a double array with default value {0.0, 0.0}.
      • properties

        public Parameter properties
        The properties to be transformed. This is a record token with value {power = 0.0, range = 0.0}.