Class Interaction

    • Field Detail

      • time

        protected final long time
        Simulation time at which the interaction happens in ns.
    • Constructor Detail

      • Interaction

        protected Interaction​(long time)
        Constructor using fields.
        Parameters:
        time - Simulation time at which the interaction happens.
      • Interaction

        protected Interaction​(long time,
                              int id)
        Creates a new interaction with the specified time and predetermined id. Except for special cases the constructor Interaction(long) should be used instead.
        Parameters:
        time - the simulation time (in ns) at which the interaction happens.
        id - the predetermined id.
    • Method Detail

      • getTime

        public final long getTime()
        Returns the simulation time at which the interaction happens in ns.
        Returns:
        simulation time in nano-seconds
      • getTypeId

        public String getTypeId()
        Returns the type identifier of the interaction.
        Returns:
        the type identifier.
      • getId

        public final int getId()
        Returns the unique ID of this interaction.
        Returns:
        the unique ID of this interaction.
      • getSenderId

        public final String getSenderId()
        Returns the ID of the sending federate.
        Returns:
        the ID of the sending federate or null if none was assigned yet.
      • setSenderId

        public final void setSenderId​(@Nonnull
                                      String senderId)
                               throws IllegalValueException
        Assigns the specified ID of the sending federate to this interaction. This method is called by the RtiAmbassador and should not be called somewhere else.
        Parameters:
        senderId - the ID of the sending federate to set.
        Throws:
        IllegalValueException - if the sender ID was already assigned.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • createTypeIdentifier

        public static String createTypeIdentifier​(Class<? extends Interaction> interactionClass)
        Helper method for creating type identifiers in a uniform way.
        Parameters:
        interactionClass - the class extending from Interaction
        Returns:
        the type identifier based on the Interaction class