|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.zcu.fav.kiv.jsim.hla.JSimHLAConnection
JSimHLAConnection provides connection between J-Sim and the Runtime Infrastructure (RTI). Instance of this class is created automatically by JSimHLASimulation when HLA is used. You should never need to create an instance of this class.
| Field Summary | |
static java.lang.String |
IC_JSIM_END_OF_SIMULATION
Interaction class JSimEndOfSimulation. |
static java.lang.String |
IC_JSIM_REQUEST
Interaction class JSimRequest. |
static java.lang.String |
IC_JSIM_RESPONSE
Interaction class JSimResponse. |
static java.lang.String |
ICP_JSIM_END_DATA
|
static java.lang.String |
ICP_JSIM_REQUEST_DATA
|
static java.lang.String |
ICP_JSIM_REQUEST_HEADER
|
static java.lang.String |
ICP_JSIM_RESPONSE_DATA
|
static java.lang.String |
ICP_JSIM_RESPONSE_HEADER
|
static int |
JSIM_HEAD_CARDINAL
|
static int |
JSIM_HEAD_EMPTY
|
static int |
JSIM_HEAD_FIRST
|
static int |
JSIM_HEAD_GET_LW
|
static int |
JSIM_HEAD_GET_TW
|
static int |
JSIM_HEAD_GET_TW_FOR_ALL_LINKS
|
static int |
JSIM_HEAD_LAST
|
static int |
JSIM_LINK_INTO
|
static int |
JSIM_PROCESS_ACTIVATE
|
static int |
JSIM_PROCESS_CANCEL
|
static int |
JSIM_PROCESS_GET_STATE
|
static int |
JSIM_PROCESS_IS_IDLE
|
static int |
JSIM_RESPONSE_NOT_RECEIVED
|
static int |
JSIM_RESULT_EXCEPTION
|
static int |
JSIM_RESULT_OK
|
static java.lang.String |
PROTOCOL_VERSION
JSim HLA Protocol version. |
| Constructor Summary | |
JSimHLAConnection(JSimHLASimulation simulation,
java.util.Properties configurationRTI)
Constructor. |
|
| Method Summary | |
protected void |
announceSynchronizationPoint(java.lang.String synchronizationPointLabel)
Notifies the federate that a synchronization point has been announced. |
protected void |
beginFederationExecution(int numberOfFederates,
int modeEndOfSimulation)
Begins JSim federation execution. |
static java.lang.Object |
byteArrayToObject(byte[] byteArray)
Deserializes object from byte array. |
protected void |
debug(java.lang.String message)
Prints debug message. |
protected void |
discoverObjectInstance(ObjectInstanceHandle theObject,
ObjectClassHandle theObjectClass,
java.lang.String objectName)
Notifies the federate of the presence of an object instance. |
protected void |
endFederationExecution(boolean destroy)
Ends JSim federation execution. |
protected void |
federationSynchronized(java.lang.String synchronizationPointLabel)
Notifies the federate that the federation has been synchronized. |
LogicalTime |
getLogicalTime()
Returns federate's granted logical time. |
void |
nextMessageRequestAvailable(LogicalTime theTime)
Calls service nextMessageRequestAvailable() of the RTIambassador. |
static byte[] |
objectToByteArray(java.lang.Object object)
Serializes specified object into byte array. |
protected void |
printErrorMessage(java.lang.String message)
Prints an error message. |
protected void |
printMessage(java.lang.String message)
Prints a message. |
void |
processReceivedInteractions()
Performs processing of received interactions stored in interactions callback queue. |
protected void |
receiveInteraction(InteractionClassHandle interactionClass,
ParameterHandleValueMap theParameters,
byte[] userSuppliedTag,
OrderType receivedOrdering)
Receives interaction from RTI. |
protected void |
reflectAttributeValues(ObjectInstanceHandle theObject,
AttributeHandleValueMap theAttributes,
byte[] userSuppliedTag,
OrderType sentOrdering,
TransportationType theTransport)
Notifies the federate of changes to the state of an object instance. |
protected JSimHLAResponse |
sendRequestHeadCardinal(java.lang.String headName)
Sends request for head.cardinal(). |
protected JSimHLAResponse |
sendRequestHeadEmpty(java.lang.String headName)
Sends request for head.empty(). |
protected JSimHLAResponse |
sendRequestHeadFirst(java.lang.String headName)
Sends request for head.first(). |
protected JSimHLAResponse |
sendRequestHeadGetLw(java.lang.String headName)
Sends request for head.getLw(). |
protected JSimHLAResponse |
sendRequestHeadGetTw(java.lang.String headName)
Sends request for head.getTw(). |
protected JSimHLAResponse |
sendRequestHeadGetTwForAllLinks(java.lang.String headName)
Sends request for head.getTwForAllLinks(). |
protected JSimHLAResponse |
sendRequestHeadLast(java.lang.String headName)
Sends request for head.last(). |
protected JSimHLAResponse |
sendRequestLinkInto(java.lang.String headName,
JSimLink link)
Sends request for link.into(). |
protected JSimHLAResponse |
sendRequestProcessActivate(java.lang.String processName,
double when)
Sends request for process.activate(). |
protected JSimHLAResponse |
sendRequestProcessCancel(java.lang.String processName)
Sends request for process.cancel(). |
protected JSimHLAResponse |
sendRequestProcessGetState(java.lang.String processName)
Sends request for process.getState(). |
protected JSimHLAResponse |
sendRequestProcessIsIdle(java.lang.String processName)
Sends request for process.isIdle(). |
protected void |
timeAdvanceGrant(LogicalTime time)
Notifies the federate that a time advance has been granted. |
protected void |
timeConstrainedEnabled(LogicalTime time)
Notifies the federate that time-constrained mode has been enabled. |
protected void |
timeRegulationEnabled(LogicalTime time)
Notifies the federate that time regulation has been enabled. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String PROTOCOL_VERSION
public static final java.lang.String IC_JSIM_REQUEST
public static final java.lang.String ICP_JSIM_REQUEST_HEADER
public static final java.lang.String ICP_JSIM_REQUEST_DATA
public static final java.lang.String IC_JSIM_RESPONSE
public static final java.lang.String ICP_JSIM_RESPONSE_HEADER
public static final java.lang.String ICP_JSIM_RESPONSE_DATA
public static final java.lang.String IC_JSIM_END_OF_SIMULATION
public static final java.lang.String ICP_JSIM_END_DATA
public static final int JSIM_PROCESS_ACTIVATE
public static final int JSIM_PROCESS_CANCEL
public static final int JSIM_PROCESS_GET_STATE
public static final int JSIM_PROCESS_IS_IDLE
public static final int JSIM_HEAD_EMPTY
public static final int JSIM_HEAD_CARDINAL
public static final int JSIM_HEAD_FIRST
public static final int JSIM_HEAD_LAST
public static final int JSIM_HEAD_GET_LW
public static final int JSIM_HEAD_GET_TW
public static final int JSIM_HEAD_GET_TW_FOR_ALL_LINKS
public static final int JSIM_LINK_INTO
public static final int JSIM_RESULT_OK
public static final int JSIM_RESULT_EXCEPTION
public static final int JSIM_RESPONSE_NOT_RECEIVED
| Constructor Detail |
public JSimHLAConnection(JSimHLASimulation simulation,
java.util.Properties configurationRTI)
simulation - Parent simulation object.configurationRTI - Configuration properties for Runtime Infrastructure (RTI).| Method Detail |
public static byte[] objectToByteArray(java.lang.Object object)
throws java.io.IOException
object - Object to be serialized.
It must implement java.io.Serializable.
java.io.IOException
public static java.lang.Object byteArrayToObject(byte[] byteArray)
throws java.io.IOException,
java.lang.ClassNotFoundException
byteArray - Byte array to be deserialized.
java.io.IOException
java.lang.ClassNotFoundExceptionprotected void printMessage(java.lang.String message)
message - message to printprotected void debug(java.lang.String message)
message - message to printprotected void printErrorMessage(java.lang.String message)
message - Error message to print.protected void timeConstrainedEnabled(LogicalTime time)
time - the current logical timeprotected void timeRegulationEnabled(LogicalTime time)
time - the current logical timeprotected void timeAdvanceGrant(LogicalTime time)
time - the new logical timeprotected void announceSynchronizationPoint(java.lang.String synchronizationPointLabel)
synchronizationPointLabel - the label of the synchronization pointprotected void federationSynchronized(java.lang.String synchronizationPointLabel)
synchronizationPointLabel - the label of the synchronization point
protected void discoverObjectInstance(ObjectInstanceHandle theObject,
ObjectClassHandle theObjectClass,
java.lang.String objectName)
theObject - the instance handle of the newly discovered objecttheObjectClass - the class handle of the newly discovered objectobjectName - the name of the newly discovered object
protected void reflectAttributeValues(ObjectInstanceHandle theObject,
AttributeHandleValueMap theAttributes,
byte[] userSuppliedTag,
OrderType sentOrdering,
TransportationType theTransport)
theObject - the instance handle of the modified objecttheAttributes - the map between attribute handles and the new values of
the identified attributesuserSuppliedTag - a user-supplied tag associated with the state changesentOrdering - the type of ordering with which the update was senttheTransport - the type of transport associated with the update
protected JSimHLAResponse sendRequestProcessActivate(java.lang.String processName,
double when)
processName - The name of the process.when - Absolute simulation time when the process should be activated.
protected JSimHLAResponse sendRequestProcessCancel(java.lang.String processName)
processName - The name of the process.
protected JSimHLAResponse sendRequestProcessGetState(java.lang.String processName)
processName - The name of the process.
protected JSimHLAResponse sendRequestProcessIsIdle(java.lang.String processName)
processName - The name of the process.
protected JSimHLAResponse sendRequestHeadEmpty(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadCardinal(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadFirst(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadLast(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadGetLw(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadGetTw(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestHeadGetTwForAllLinks(java.lang.String headName)
headName - The name of the head.
protected JSimHLAResponse sendRequestLinkInto(java.lang.String headName,
JSimLink link)
headName - The name of the head.
protected void receiveInteraction(InteractionClassHandle interactionClass,
ParameterHandleValueMap theParameters,
byte[] userSuppliedTag,
OrderType receivedOrdering)
interactionClass - the class of the received interactiontheParameters - the map between parameter handles and the values of
the identified parametersuserSuppliedTag - a user-supplied tag associated with the interactionpublic void processReceivedInteractions()
public LogicalTime getLogicalTime()
public void nextMessageRequestAvailable(LogicalTime theTime)
protected void beginFederationExecution(int numberOfFederates,
int modeEndOfSimulation)
throws JSimInvalidParametersException
numberOfFederates - Total number of federates who are involved in federation.modeEndOfSimulation - The mode how to terminate the HLA simulation.
Possible values are HLA_END_OF_SIMULATION_RESPECT and HLA_END_OF_SIMULATION_IGNORE.
JSimInvalidParametersException - This exception is thrown number of federates is less than two,
or endOfSimulation has an unknown value.protected void endFederationExecution(boolean destroy)
destroy - Determines if to destroy federation execution or not.
Federation execution of JSim federation should be always destroyed.
Please use false only if you know what are you doing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||