Subsections

2.1.3 Object Management

2.1.3.1 Object Registration

\begin{figure}\centering
\pagecolor{white}
\begin{msc}{Object Registration}
\dra...
...oveObjectInstance}{m2}{m3}
\nextlevel
\end{msc}\textcolor{white}{.} \end{figure}

registerObjectInstance( objectClass[, objectName])

Returns an object handle.

May raise ObjectClassNotDefined, ObjectClassNotPublished, ObjectAlreadyRegistered, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

discoverObjectInstance( object, objectClass, objectName)

May raise CouldNotDiscover, ObjectClassNotKnown.

turnUpdatesOnForObjectInstance( object, (attribute))

May raise ObjectNotKnown, AttributeNotOwned.

turnUpdatesOffForObjectInstance( object, (attribute))

May raise ObjectNotKnown, AttributeNotOwned.

deleteObjectInstance( object, tag[, time])

Returns eventRetraction handle.

May raise ObjectNotKnown, DeletePrivilegeNotHeld, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

removeObjectInstance( object, tag[, time, eventRetraction])

May raise ObjectNotKnown, InvalidFederationTime.

localDeleteObjectInstance( object)

May raise ObjectNotKnown, FederateOwnsAttributes, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

getObjectClass( object)
Returns object class handle.

May raise ObjectNotKnown, FederateNotExecutionMember, ConcurrentAccessAttempted.

getObjectInstanceHandle( objectName)
Returns object handle.

May raise ObjectNotKnown, FederateNotExecutionMember, ConcurrentAccessAttempted.

getObjectInstanceName( object)
Returns object name.

May raise ObjectNotKnown, FederateNotExecutionMember, ConcurrentAccessAttempted.

getTransportationHandle( transportationName)
Returns transportation type handle.

May raise NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted.

getTransportationName( transportation)
Returns transportation type name.

May raise InvalidTransportationHandle, FederateNotExecutionMember, ConcurrentAccessAttempted.

changeAttributeTransportationType( object, (attribute), transportation)

May raise ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, InvalidTransportationHandle, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

2.1.3.2 Attribute Value Update

\begin{figure}\centering
\pagecolor{white}
\begin{msc}{Attribute Value Update}
\...
...ctAttributeValues}{m2}{m3}
\nextlevel
\end{msc}\textcolor{white}{.} \end{figure}

requestObjectAttributeValueUpdate( object, (attribute))

May raise ObjectNotKnown, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

requestClassAttributeValueUpdate( objectClass, (attribute))

May raise ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

provideAttributeValueUpdate( object, (attribute))

May raise ObjectNotKnown, AttributeNotKnown, AttributeNotOwned.

updateAttributeValues( object, {attribute:value}, tag[, time])
object is the object instance handle obtained from rtia.registerObjectInstance
{attribute:value} is a python dictionary whose key are attribute handles with associated values.
tag is a string
time may be a timestamp
Returns eventRetraction handle.

For example

rtia.updateAttributeValues(thisObject,
            {textAttributeHandle:"text"},
            "update")
    
rtia.updateAttributeValues(thisObject,
            {structAttributeHandle:struct.pack('hhl', 1, 2, 3)}
            "update")
            
rtia.updateAttributeValues(thisObject,
    {wordLocationHandle:fom.WorldLocationStruct.pack({"X":1,"Y":2,"Z":3})},
    "update")            
            
rtia.updateAttributeValues(thisObject,
            {textAttributeHandle:"text",
            structAttributeHandle:struct.pack('hhl', 1, 2, 3),           
            wordLocationHandle:fom.WorldLocationStruct.pack({"X":1,"Y":2,"Z":3})},
            "update")

Several methods may be used to encode the data before sending the update. The first one use text encoding, the second uses the python builtin struct encoding http://docs.python.org/library/struct.html and the last one uses the builtin PyHLA FOM encoding using IEEE-1516 standard encoding. The fom object used in this example is the result of something like:

import hla.omt as fom

#Include RPR-FOM data types
fom.HLAuse('rpr2-d18.xml')
The previous code should have defined the RPR-FOM datatype WorldLocationStruct used in the previous example. Note however that you may use the predefined builtin IEEE-1516 types without loading any FOM data type file. This is shown in the following example:
import hla.omt as fom

...
rtia.updateAttributeValues(thisObject,
            {attributeHandle:fom.HLAfloat32BE.pack(3.14)},
            "update")

May raise ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

reflectAttributeValues( object, {attribute:value}, tag, orderType, transportType[, time, eventRetraction])
Received attribute values are received in a dictionary. Attribute handle is used as key. The value can be unpacked using the hla.omt functions.
object is an object instance handle
{attribute:value} is a python dictionary whose key are attribute handles with associated values.
tag is a string
orderType
transportType
time may be a timestamp
eventRetraction

For example

def reflectAttributeValues(self, object, attributes, tag, order, transport):
    location, size = fom.WorldLocationStruct.unpack(attributes[self.wordLocationHandle])
    print "REFLECT", location

May raise ObjectNotKnown, AttributeNotKnown, FederateOwnsAttributes, InvalidFederationTime.

2.1.3.3 Exchanging Interactions

\begin{figure}\centering
\pagecolor{white}
\begin{msc}{Exchanging Interactions}
...
...eceiveInteraction}{m2}{m3}
\nextlevel
\end{msc}\textcolor{white}{.} \end{figure}

getParameterHandle( parameterName, interactionClass)
Returns interaction parameter handle.

May raise InteractionClassNotDefined, NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted.

getParameterName( parameter, interactionClass)
Returns interaction parameter name.

May raise InteractionClassNotDefined, InteractionParameterNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted.

sendInteraction( interactionClass, {parameter:value}, tag[, time])

Returns eventRetraction handle.

May raise InteractionClassNotDefined, InteractionClassNotPublished, InteractionParameterNotDefined, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.

receiveInteraction( interactionClass, {parameter:value}, tag, orderType, transportType[, time, eventRetraction])

May raise InteractionClassNotKnown, InteractionParameterNotKnown, InvalidFederationTime.

changeInteractionTransportationType( interactionClass, transportation)

May raise InteractionClassNotDefined, InteractionClassNotPublished, InvalidTransportationHandle, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress.