Two way coupling with EMRALD is done through XMPP messaging. An expandable protocol has been developed to allow for standard messages of "Actions" and "Events" to govern what happens both on the EMRALD server and the simulation clients. A XMPP server is run as part of the EMRALD solve engine which handles all the message passing. This allows EMRALD and the simulation codes to run on different machines or even different networks. These messages are JSON strings and a schema has been defined to allow validation of messages.  

 EMRALD messaging protocol.png

Actions

Actions are sent by EMRALD to a client simulation stating an action to perform.  The following are the actions that can be sent:

  • Component Modify (atCompModify) – Modify a components properties according to the specified data.
  • Open Simulation (atOpenSim) – Open the specified simulation or file.
  • Cancel Simulation (atCancelSim) – Cancel the currently running simulation.
  • Pause Simulation (atPauseSim) – Pause the current simulation.
  • Continue Simulation (atContinue) – Continue the simulation after an event was sent, a new simulation was open, or a pause was sent.
  • Timer (atTimer) – Pause at the given time and check back with the EMRALD simulation at the given time for any changes.
  • Reset (atReset) – Reset the simulation back to the beginning.
  • Restart at a given time (atRestartAtTime) – Back up the current simulation back to the given time.
  • Ping (atPing) – Check to see if a client is still connected, client simulation must respond back to a ping.
  • Status (atStatus) – Check to see if client simulation is still running, client must respond.

 

Events

Events are sent by a client indicating something has happened on the client that may affect the EMRALD simulation.These include the following:

  • Component Event (etCompEv) – A property of a component of interest has changed in the coupled simulation.
  • Timer (etTimer) – The time of the coupled simulation has reached the designated callback time.
  • Simulation Started (etSimStarted) – The coupled simulation has started.
  • Simulation Ended (etEndSim) – The coupled simulation has ended.
  • Status (etStatus) – Return of a status request action.