Liking cljdoc? Tell your friends :D

cark.behavior-tree.context

The context map contain all the (live and static) data of a behavior tree.

It has a notably flat structure, where database, static tree and dynamic extent are merged into it. So that the context also is the database and the tree, as well as other keys merged into these.

This means that functions from the db and tree namespaces can be called on a context map.

Wherever a node has a function parameter, the context map is always the first (and often only) parameter passed to it.

The context map contain all the (live and static) data of a behavior tree.

It has a notably flat structure, where database, static tree and dynamic extent are
merged into it. So that the context also is the database and the tree, as well as other keys 
merged into these. 

This means that functions from the db and tree namespaces can be called on a context map.

Wherever a node has a function parameter, the context map is always the first (and often only) parameter passed to it.
raw docstring

baseclj/s

A base context object

A base context object
sourceraw docstring

cancelclj/s

(cancel ctx node-id)

Resets the node's children, removes its data from the database, and, when the node is an on-cancel node, ticks its cancel child node.

Resets the node's children, removes its data from the database, and, when the node is an on-cancel node, ticks its cancel child node.
sourceraw docstring

clear-tracingclj/s

(clear-tracing ctx)

Disables tracing on this context

Disables tracing on this context
sourceraw docstring

default-max-tick-countclj/s

The maximum number of node ticks that may occur during a single tree tick

The maximum number of node ticks that may occur during a single tree tick
sourceraw docstring

do-nodesclj/s

(do-nodes ctx node-ids func)

Applies the func to each of the provided nodes, threading the context along. func will be called with the threaded context and a node-id, and must return a possibly updated context.

Applies the func to each of the provided nodes, threading the context along.
func will be called with the threaded context and a node-id, and must return a possibly updated context.
sourceraw docstring

get-max-tick-countclj/s

(get-max-tick-count context)

Returns the maximum number of node ticks that may occur during a single tree tick. An error will be thrown if this number is exceeded.

Returns the maximum number of node ticks that may occur during a single tree tick. 
An error will be thrown if this number is exceeded.
sourceraw docstring

get-node-children-idsclj/s

(get-node-children-ids ctx node-id)

Returns the ids of the children nodes to the provided node-id

Returns the ids of the children nodes to the provided node-id
sourceraw docstring

get-tick-countclj/s

(get-tick-count context)

Returns the current tick count since the start of the tree tick evaluation.

Returns the current tick count since the start of the tree tick evaluation.
sourceraw docstring

inc-tick-countclj/s

(inc-tick-count context)

Increases the current tick count, possibly throwing an error is it goes over the max-tick-count threshold.

Increases the current tick count, possibly throwing an error is it goes over the max-tick-count threshold.
sourceraw docstring

keysclj/s

Keys that can be found in a context map

Keys that can be found in a context map
sourceraw docstring

makeclj/s

(make db tree)

Returns a context object based on on the provided database and static tree

Returns a context object based on on the provided database and static tree
sourceraw docstring

reset-nodesclj/s

(reset-nodes ctx node-ids)

Sets the provided nodes to the :fresh status

Sets the provided nodes to the :fresh status
sourceraw docstring

reset-tick-countclj/s

(reset-tick-count context)

Resets the rick count of this context. Mostly internal use.

Resets the rick count of this context. Mostly internal use.
sourceraw docstring

set-max-tick-countclj/s

(set-max-tick-count context value)

Sets the maximum tick count

Sets the maximum tick count
sourceraw docstring

set-node-statusclj/s

(set-node-status ctx node-id new-status)

Sets the status of a node, possibly cancelling it if it goes from :running to :fresh.

Sets the status of a node, possibly cancelling it if it goes from :running to :fresh.
sourceraw docstring

set-tracingclj/s

(set-tracing ctx)

Enabled tracing on this context, sending treacing information to the tap. Note that this can be done at any moment.

Enabled tracing on this context, sending treacing information to the tap.
Note that this can be done at any moment.
sourceraw docstring

specific-keysclj/s

Keys specific to the context map

Keys specific to the context map
sourceraw docstring

tickclj/s

(tick ctx node-id)

Ticks a node if it's in the :fresh or :running status, increasing the tick count.

Ticks a node if it's in the :fresh or :running status, increasing the tick count.
sourceraw docstring

tracing-tickclj/s

(tracing-tick ctx node-id)

Ticks a node while sending some debugging information to the tap

Ticks a node while sending some debugging information to the tap
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close