Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tum-far/ubii-interactions

webers380.2.2

Ubii interactions module.

readme

ubii interactions

This provides the Ubi-Interact module of Interactions as a relation of Cause(s) and Effect(s).

Description

Interactions are composed as a list of Causes and Effects. If any of the Causes are fulfilled all associated Effects will be triggered.

Causes/Effects are defined by any piece of code (Javascript for now) that can serve as the respective function. This function looks like:

  • function (input, state) { ... your code here ... } (Cause)
  • function (output, state) { ... your code here ... } (Effect)

For Cause, if the body of this function returns true, it is counted as fulfilled.

  • input (read-only): internal name for a variable that is mapped to outside topic data buffer.
  • state (read-write): internal state of the Interaction instance.
  • output (write-only): internal name for a variable that is mapped to outside topic data buffer.

This mapping of input/output to external topics needs to be defined for an instance of Interaction.

Testing

Run npm test.