automata v0.1.0 Automaton.Types.BT.Behavior behaviour
An Automaton.Types.BT.Behavior is an abstract interface for composites and components that can be activated, run, and deactivated. Actions(Execution Nodes) provide specific implementations of this interface. Branches in the tree can be thought of as high level behaviors, heirarchically combining smaller behaviors to provide more complex and interesting behaviors.
Note: there is a bunch of placeholder stuff in here right now and needs thought and cleanup. The specs for the callbacks are not accurate, just needed something that compiled and ran. Needs more thought and attention as the design process continues.
Link to this section Summary
Types
All nodes start with a statuses of :bh_fresh
.
A BT node can be in one of five statuses
Link to this section Types
status()
Specs
status() :: :bh_aborted | :bh_failure | :bh_fresh | :bh_running | :bh_success
All nodes start with a statuses of :bh_fresh
.
A BT node can be in one of five statuses:
- :bh_fresh (when never run, or when reset)
- :bh_running (when running an async user action)
- :bh_failure
- :bh_success
- :bh_aborted (when aborted due to exits & exceptions)
Link to this section Callbacks
abort()
Specs
abort() :: atom()
aborted?()
Specs
aborted?() :: bool() | nil
on_init(term)
Specs
on_terminate(term)
Specs
reset()
Specs
reset() :: atom()
running?()
Specs
running?() :: bool() | nil
status()
Specs
status() :: status()
terminated?()
Specs
terminated?() :: bool() | nil
update(any)
Specs
update(any()) :: {:ok, Module.t()}