edu
Class WBFedAmb

edu.BaseFedAmb
  |
  +--edu.WBFedAmb

public class WBFedAmb
extends BaseFedAmb

This is callback object to receive RTI messages. We used the following callback messages for this demo program:

  1. discoverObjectInstance

  2. removeObjectInstance[With Time]

  3. reflectAttributeValues[WithTime]

  4. provideAttributeValueUpdate

  5. turnUpdatesOnForObjectInstance

  6. turnUpdatesOffForObjectInstance

  7. timeAdcanceGrant

  8. timeRegulationEnabled

  9. timeConstrainedEnabled


Field Summary
(package private)  RTIObjectsContainer boss
           
(package private)  java.io.PrintWriter myLog
           
 
Constructor Summary
WBFedAmb(RTIObjectsContainer father)
           
 
Method Summary
 void discoverObjectInstance(int theObject, short theObjectClass)
          Add this new discovered object to the EntityManager.
 void provideAttributeValueUpdate(int theObject, short[] theAttributes)
          Ask the corresponding SimCountry object to update its attribute.
 void receiveInteraction(short theInteraction, RTIcap.ParameterHandleValuePair[] theParameters, java.lang.String theTag)
           
 void receiveInteractionWithTime(short theInteraction, RTIcap.ParameterHandleValuePair[] theParameters, double theTime, java.lang.String theTag, RTIcap.EventRetractionHandle theHandle)
           
 void reflectAttributeValues(int theObject, RTIcap.AttributeHandleValuePair[] theAttributes, java.lang.String theTag)
          Find the objects in the EntityManager and updates their received attributes.
 void reflectAttributeValuesWithTime(int theObject, RTIcap.AttributeHandleValuePair[] theAttributes, double theTime, java.lang.String theTag, RTIcap.EventRetractionHandle theHandle)
          Update attributes.
 void removeObjectInstance(int theObject, java.lang.String theTag)
          Remove the corresponding object from EntityManager.
 void removeObjectInstanceWithTime(int theObject, double theTime, java.lang.String theTag, RTIcap.EventRetractionHandle theHandle)
          Remove the corresponding object from EntityManager.
 void timeAdvanceGrant(double theTime)
          Change the HelloWorld federation's time.
 void timeConstrainedEnabled(double theTime)
          Change the HelloWorld federate's time.
 void timeRegulationEnabled(double theTime)
          Change the HelloWorld federate's time.
 void turnUpdatesOffForObjectInstance(int theObject, short[] theAttributes)
          Tell simulated object *NOT* to send its updates to RTI.
 void turnUpdatesOnForObjectInstance(int theObject, short[] theAttributes)
          Tell simulated object to send its updates to RTI.
 
Methods inherited from class edu.BaseFedAmb
announceSynchronizationPoint, attributeIsNotOwned, attributeIsOwnedByRTI, attributeOwnershipAcquisitionNotification, attributeOwnershipDivestitureNotification, attributeOwnershipUnavailable, attributesInScope, attributesOutOfScope, changeThresholds, confirmAttributeOwnershipAcquisitionCancellation, federationNotRestored, federationNotSaved, federationRestoreBegun, federationRestored, federationSaved, federationSynchronized, informAttributeOwnership, initiateFederateRestore, initiateFederateSave, requestAttributeOwnershipAssumption, requestAttributeOwnershipRelease, requestFederationRestoreFailed, requestFederationRestoreSucceeded, requestRetraction, startRegistrationForObjectClass, startUpdates, stopRegistrationForObjectClass, stopUpdates, synchronizationPointRegistrationFailed, synchronizationPointRegistrationSucceeded, turnInteractionsOff, turnInteractionsOn
 

Field Detail

boss

RTIObjectsContainer boss

myLog

java.io.PrintWriter myLog
Constructor Detail

WBFedAmb

public WBFedAmb(RTIObjectsContainer father)
Method Detail

discoverObjectInstance

public void discoverObjectInstance(int theObject,
                                   short theObjectClass)
                            throws RTIcap.CouldNotDiscover,
                                   RTIcap.ObjectClassNotKnown,
                                   RTIcap.InvalidFederationTime,
                                   RTIcap.FederateInternalError
Add this new discovered object to the EntityManager.

reflectAttributeValuesWithTime

public void reflectAttributeValuesWithTime(int theObject,
                                           RTIcap.AttributeHandleValuePair[] theAttributes,
                                           double theTime,
                                           java.lang.String theTag,
                                           RTIcap.EventRetractionHandle theHandle)
                                    throws RTIcap.ObjectNotKnown,
                                           RTIcap.AttributeNotKnown,
                                           RTIcap.FederateOwnsAttributes,
                                           RTIcap.InvalidFederationTime,
                                           RTIcap.FederateInternalError
Update attributes.

reflectAttributeValues

public void reflectAttributeValues(int theObject,
                                   RTIcap.AttributeHandleValuePair[] theAttributes,
                                   java.lang.String theTag)
                            throws RTIcap.ObjectNotKnown,
                                   RTIcap.AttributeNotKnown,
                                   RTIcap.FederateOwnsAttributes,
                                   RTIcap.FederateInternalError
Find the objects in the EntityManager and updates their received attributes. Note that, CDR provided us the necessary decode/encode mechanism for various data types.

receiveInteractionWithTime

public void receiveInteractionWithTime(short theInteraction,
                                       RTIcap.ParameterHandleValuePair[] theParameters,
                                       double theTime,
                                       java.lang.String theTag,
                                       RTIcap.EventRetractionHandle theHandle)
                                throws RTIcap.InteractionClassNotKnown,
                                       RTIcap.InteractionParameterNotKnown,
                                       RTIcap.InvalidFederationTime,
                                       RTIcap.FederateInternalError
Overrides:
receiveInteractionWithTime in class BaseFedAmb

receiveInteraction

public void receiveInteraction(short theInteraction,
                               RTIcap.ParameterHandleValuePair[] theParameters,
                               java.lang.String theTag)
                        throws RTIcap.InteractionClassNotKnown,
                               RTIcap.InteractionParameterNotKnown,
                               RTIcap.FederateInternalError
Overrides:
receiveInteraction in class BaseFedAmb

removeObjectInstanceWithTime

public void removeObjectInstanceWithTime(int theObject,
                                         double theTime,
                                         java.lang.String theTag,
                                         RTIcap.EventRetractionHandle theHandle)
                                  throws RTIcap.ObjectNotKnown,
                                         RTIcap.InvalidFederationTime,
                                         RTIcap.FederateInternalError
Remove the corresponding object from EntityManager.

removeObjectInstance

public void removeObjectInstance(int theObject,
                                 java.lang.String theTag)
                          throws RTIcap.ObjectNotKnown,
                                 RTIcap.FederateInternalError
Remove the corresponding object from EntityManager.

provideAttributeValueUpdate

public void provideAttributeValueUpdate(int theObject,
                                        short[] theAttributes)
                                 throws RTIcap.ObjectNotKnown,
                                        RTIcap.AttributeNotKnown,
                                        RTIcap.AttributeNotOwned,
                                        RTIcap.FederateInternalError
Ask the corresponding SimCountry object to update its attribute.

turnUpdatesOnForObjectInstance

public void turnUpdatesOnForObjectInstance(int theObject,
                                           short[] theAttributes)
                                    throws RTIcap.ObjectNotKnown,
                                           RTIcap.AttributeNotOwned,
                                           RTIcap.FederateInternalError
Tell simulated object to send its updates to RTI.

turnUpdatesOffForObjectInstance

public void turnUpdatesOffForObjectInstance(int theObject,
                                            short[] theAttributes)
                                     throws RTIcap.ObjectNotKnown,
                                            RTIcap.AttributeNotOwned,
                                            RTIcap.FederateInternalError
Tell simulated object *NOT* to send its updates to RTI.

timeAdvanceGrant

public void timeAdvanceGrant(double theTime)
                      throws RTIcap.InvalidFederationTime,
                             RTIcap.TimeAdvanceWasNotInProgress,
                             RTIcap.FederateInternalError
Change the HelloWorld federation's time. And inform that time is advanced.

timeRegulationEnabled

public void timeRegulationEnabled(double theTime)
                           throws RTIcap.InvalidFederationTime,
                                  RTIcap.EnableTimeRegulationWasNotPending,
                                  RTIcap.FederateInternalError
Change the HelloWorld federate's time. And inform that time is advanced.

timeConstrainedEnabled

public void timeConstrainedEnabled(double theTime)
                            throws RTIcap.InvalidFederationTime,
                                   RTIcap.EnableTimeConstrainedWasNotPending,
                                   RTIcap.FederateInternalError
Change the HelloWorld federate's time. And inform that time is advanced.