Entity-component design

Outcome simulations are based on a component-based approach, where the system consists of a set of entities to which components are attached.

Entity

Entity

Additionally components contain finite-state machines. See the next sub-chapter to learn more about that.

Generic

On the level of the engine, entities and components are mostly generic - they are instead defined from user files.

Entity/Component types?

When combined with entities and components, "type" can mean different things.

Entity type

When it comes to entities, a type of an entity defines what components it gets upon instantiation.

It's a label that can be then used inside a component declaration to add. It works two ways, we can also specify components for entity types, but it's less convenient to do so.

Component type

We can use component type to specify . Declaration of a new component type can contain a .

Component type can be also used as a way of organizing components, and/or expanding the component namespace. Consider the following example:

# declare a new component type
component_type:
- id: decision
  vars:
  - id: template_var
  ...
  states:
  - id: template_state_1
  ...

# use the new component type
component:
- id: choice_213
  type: decision
  
# component `choice_213` has a var `template_var`
# /region/e_01001/decision/