Skip to content

Defining custom reactions

Adam Mashinchi edited this page Jul 30, 2021 · 1 revision

A guide to defining custom reaction files.

Contents

Reaction files

Reactions are JSON objects that specify a list of objectives called "atoms." A reaction executes its atoms in order. You can give an atom any name you like, but remember to define all atoms in an atom file.

This is an example reaction file:

{
    "name": "name_of_reaction",
    "atoms": [
      "EXAMPLE-ATOM-1",
      "EXAMPLE-ATOM-2"
    ]
}

Atom files

Atoms are JSON objects that perform one or more actions called "quarks." An atom executes each quark in order. If a quark fails for any reason, the execution stops.

This is an example atom file:

[
    {
        "name": "EXAMPLE-ATOM-1",
        "<quark-type>": [QUARK-ARGS]
    },
    {
        "name": "EXAMPLE-ATOM-2",
        "<quark-type>": [QUARK-ARGS],
        "<quark-type>": [QUARK-ARGS]
    }
]

For a list of available quark types, see Quark types.

Compiling executables

Use the compose_reaction script to build executables from reaction files:

python3 compose_reaction <atoms file> <reaction file> <output file>
Clone this wiki locally