
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
pome-bt is a Behavior-Tree module for pome project to implement AI. More information about Behavior-Tree please refer other articles from Internet, such as [Understanding Behavior Trees](http://aigamedev.com/open/article/bt-overview/).
#pome-bt - behavior tree for node.js
pome-bt is a Behavior-Tree module for pome project to implement AI. More information about Behavior-Tree please refer other articles from Internet, such as Understanding Behavior Trees.
##Installation
npm install pome-bt
##Behavior tree nodes
###Node The base class of all the behavior tree node classes. Its constructor receives a blackboard instance as parameter.
Each node class provides a doAction method to fire the behavior of current node instance. All the children should implement their own doAction. And the doAction method sould report a result code to the parent when it return. The result code is one of below:
###Composite
The base class of all the composite nodes. A composite node has arbitrary child nodes and it has a addChild method to add child node.
###Decorator
The base class of all the decorator nodes. A decorator node has the ability to decorate the result for its child node. A decorator node has only one child node and has a setChild method to set the child node.
Followings are some behavior node types provided in pome-bt.
##Composite nodes
###Sequence
Implementation of sequence semantics.
####Sequence(opts)
###Parallel Implementation of parallel semantics. ####Parallel(opts)
Parallel.POLICY_FAIL_ON_ONE(default) return RES_FAIL if one child node fail, Parallel.POLICY_FAIL_ON_ALL return RES_FAIL only on all the child nodes fail.###Selector Implementation of selector semantics. ####Selector(opts)
###Decorator nodes ###Loop Implementation of loop semantics. ####Loop(opts)
###Condition
Return RES_SUCESS if the condition is true otherwise return RES_FAIL.
####Condition(opts)
##Other nodes ###If Implementation of loop semantics. If the condition is true, then fire the child node. ####If(opts)
##Usage
var util = require('util');
var bt = require('pome-bt');
var Sequence = bt.Sequence;
var Node = bt.Node;
// define some action nodes
var HelloNode = function(blackboard) {
Node.call(this, blackboard);
};
util.inherits(HelloNode, Node);
HelloNode.prototype.doAction = function() {
console.log('Hello ');
return bt.RES_SUCCESS;
};
var WorldNode = function(blackboard) {
Node.call(this, blackboard);
};
util.inherits(WorldNode, Node);
WorldNode.prototype.doAction = function() {
console.log('World');
return bt.RES_SUCCESS;
};
var blackboard = {};
// composite your behavior tree
var seq = new Sequence({blackboard: blackboard});
var hello = new HelloNode(blackboard);
var world = new WorldNode(blackboard);
seq.addChild(hello);
seq.addChild(world);
// run the behavior tree
seq.doAction();
FAQs
pome-bt is a Behavior-Tree module for pome project to implement AI. More information about Behavior-Tree please refer other articles from Internet, such as [Understanding Behavior Trees](http://aigamedev.com/open/article/bt-overview/).
We found that pome-bt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.