Class HlaSubscriber

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

    public class HlaSubscriber
    extends TypedAtomicActor
    implements HlaReflectable
    This actor provides information to subscribe, discover and reflect (i.e., receive) updated values in the Ptolemy-HLA/CERTI framework.

    This actor is associated with a unique HLA attribute of a given object instance. Reflected values of this HLA attribute are received from the HLA Federation by the HlaManager attribute deployed in the same model. The HlaManager invokes the putReflectedAttribute() to put the received value in the HlaSubscriber actor token queue and to program its firing time, using the _fireAt() method.

    Parameters classObjectName and attributeName need to match the name of the class and the name of the attribute defined in the Federate Object Model (FOM) specified for the Federation and indicated in the FED file. The data type of the output port of this actor must have the same type of the HLA attribute (defined in the FOM, not present in the FED file).

    The parameter classInstanceName is chosen by the user.

    Entering in more details: This actor provides 3 information: a class name C, an attribute name attr and an instance name i. To each HlaSubscriber actor in a Ptolemy model (federate) corresponds a unique HlaPublisher actor in a (unique) federate with the same information. Let us recall some terms: - FOM: Federation Object Model - FED: Federation Execution Data, contains classes and attributes defined in the FOM and, for each attribute, if it is timestamped and its QoS - RTI: Run-Time Infrastructure. The RTI has a Central RTI Component (CRC) and one or more Local RTI Components (LRC). The LRC has a numerical representation (handle) for all object classes and object class attributes contained in the FED file. The information supplied in this actor by the user is used in the following way by the HlaManager attribute (deployed in the same model): 1. During the initialization phase, the HlaManager: - Subscribes to all the kattr-kC (gathered from kclassHandleC; _attributesLocal is the set constructed by calling rtia.getAttributeHandle() for each attrC); - Receives the HLA callback informing the discovering of an instance of class C named i: rtia.discoverObjectInstance(instanceHandle, classHandle, someName), with someName = i; instanceHandle and classHandle are handles provided by the RTI. 2. During the simulation loop phase, the HlaManager receives the RAV callback from the RTI with the new value of an attribute of a class instance. Each HlaSubscriber actor is related to one RAV callback: rtia.reflectAttributeValues(instanceHandle, suppAttributes, tag, ravTimeStamp). The RAV callback, with a timestamp t'=ravTimeStamp<\i> is received at the input port of the HlaPublisher actor, during the advance time phase that starts when the federate wants to advanced its time to t<\i> (using NER or TAR time management, see HlaManager code). The optional parameter tag is not used in the current implementation.

    Since:
    Ptolemy II 11.0
    Version:
    $Id: HlaSubscriber.java 214 2018-04-01 13:32:02Z j.cardoso $
    Author:
    Gilles Lasnier, Contributors: Patricia Derler, David Come
    Pt.AcceptedRating:
    Red (glasnier)
    Pt.ProposedRating:
    Yellow (glasnier)
    • Field Detail

      • attributeName

        public Parameter attributeName
        The HLA attribute name the HLASubscriber is mapped to.
      • classObjectName

        public Parameter classObjectName
        The object class of the HLA attribute to subscribe to.
      • classInstanceName

        public Parameter classInstanceName
        The name of the HLA class instance for this HlaSubscriber.
      • typeSelector

        public StringParameter typeSelector
        The type of the output port specified through the user interface.
      • useCertiMessageBuffer

        public Parameter useCertiMessageBuffer
        Indicate if the event is wrapped in a CERTI message buffer.