RTIHostFederate JavaScript is disabled on your browser. runtime

Class RTIHostFederate

    All Implemented Interfaces:
    java.lang.Runnable


    public class RTIHostFederate
    extends java.lang.Object
    implements java.lang.Runnable

      Constructor Summary

      Constructors 
      Constructor and Description
      RTIHostFederate(java.lang.String federateName, Container user) 

      Method Summary

      Methods 
      Modifier and Type Method and Description
      private void advanceTime(double timestep) This method will request a time advance to the current time, plus the given timestep.
      void checkAndSendInteractions() 
      private byte[] convertTime(double time) Converts a double time to the expected serialized form
      private void enableTimePolicy() This method will attempt to enable the various time related properties for the federate
      private java.lang.String generateTag() 
      private void log(java.lang.String message) This is just a helper method to make sure all logging it output in the same form
      static void main(java.lang.String[] args) 
      private void publishAndSubscribe() This method will inform the RTI about the types of data that the federate will be creating, and the types of data we are interested in hearing about as other federates produce it.
      java.lang.Runnable resume() 
      void run() 
      void runFederate() This is the main simulation loop.
      void sendInteraction() This method will send out an interaction of the type InteractionRoot.Communication.
      private void waitForUser() This method will block until the user presses enter

        Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

      Field Detail

        READY_TO_RUN

        public static final java.lang.String READY_TO_RUN
        The sync point all federates will sync up on before starting
        See Also:
        Constant Field Values

        rtiAmb

        private hla.rti13.java1.RTIambassador rtiAmb

        firstTime

        private boolean firstTime

        federateName

        private java.lang.String federateName

        federationName

        private static java.lang.String federationName

        jFrame

        public javax.swing.JFrame jFrame

        isWait

        private boolean isWait

        destroy

        public boolean destroy

      Constructor Detail

        RTIHostFederate

        public RTIHostFederate(java.lang.String federateName,
                       Container user)

      Method Detail

        log

        private void log(java.lang.String message)
        This is just a helper method to make sure all logging it output in the same form

        waitForUser

        private void waitForUser()
        This method will block until the user presses enter

        convertTime

        private byte[] convertTime(double time)
        Converts a double time to the expected serialized form

        runFederate

        public void runFederate()
                         throws hla.rti13.java1.RTIexception
        This is the main simulation loop. It can be thought of as the main method of the federate. For a description of the basic flow of this federate, see the class level comments
        Throws:
        hla.rti13.java1.RTIexception

        resume

        public java.lang.Runnable resume()

        checkAndSendInteractions

        public void checkAndSendInteractions()

        enableTimePolicy

        private void enableTimePolicy()
                               throws hla.rti13.java1.RTIexception
        This method will attempt to enable the various time related properties for the federate
        Throws:
        hla.rti13.java1.RTIexception

        publishAndSubscribe

        private void publishAndSubscribe()
                                  throws hla.rti13.java1.RTIexception
        This method will inform the RTI about the types of data that the federate will be creating, and the types of data we are interested in hearing about as other federates produce it.
        Throws:
        hla.rti13.java1.RTIexception

        sendInteraction

        public void sendInteraction()
                             throws hla.rti13.java1.RTIexception
        This method will send out an interaction of the type InteractionRoot.Communication. Any federates which are subscribed to it will receive a notification the next time they tick(). Here we are passing only two of the three parameters we could be passing, but we don't actually have to pass any at all!
        Throws:
        hla.rti13.java1.RTIexception

        advanceTime

        private void advanceTime(double timestep)
                          throws hla.rti13.java1.RTIexception
        This method will request a time advance to the current time, plus the given timestep. It will then wait until a notification of the time advance grant has been received.
        Throws:
        hla.rti13.java1.RTIexception

        generateTag

        private java.lang.String generateTag()

        main

        public static void main(java.lang.String[] args)

        run

        public void run()
        Specified by:
        run in interface java.lang.Runnable