Current section
Files
Jump to
Current section
Files
include/bt_nodes.hrl
%% record definitions for nodes
%% TODO: should probably prefix everything with bt_ eg. bt_decorator
-record(decorator, {
name :: string(),
module :: atom(),
args :: map(),
state :: term(),
child :: term(),
metadata :: bt_metadata()
}).
-record(sequence, {
name :: string(),
namespace :: namespace(),
children :: list(term()),
metadata :: bt_metadata()
}).
%% TODO: add selector
-record(selector, {
name :: string(),
namespace :: namespace(),
children :: list(term()),
metadata :: bt_metadata()
}).
-record(task, {
name :: string(),
module :: atom(),
args :: map(),
state :: term(),
metadata :: bt_metadata()
}).
-record (bt_metadata, {
status=not_run :: status() | not_run,
%% these are all optional right now, not filling them since not using them.
prev_state :: term(),
prev_bb :: blackboard() | undefined,
next_bb :: blackboard() | undefined
}).
-type namespace() :: list(string()) | undefined.
-type decorator() :: #decorator{}.
-type sequence() :: #sequence{}.
-type selector() :: #selector{}.
-type task() :: #task{}.
-type blackboard() :: map().
-type event() :: term().
-type status() :: success | failure | running.
-type bt_metadata() :: #bt_metadata{} | undefined.
-type bt_node() :: decorator() | sequence() | selector() | task().