Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blueshell

Package Overview
Dependencies
Maintainers
2
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blueshell

A Behavior Tree implementation in modern Javascript.

  • 1.4.0-noEvents.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
284
decreased by-4.05%
Maintainers
2
Weekly downloads
 
Created
Source

Blueshell is a Promise-based Behavior Tree implementation using modern ES6 syntax.

Circle CI

Node Types

Actions (aka Tasks or Execution Nodes)

  • Action
  • Condition

Composites (aka Control Flow Nodes)

  • Selector (aka Priority or Fallback)

    • Runs to each child until one of them returns SUCCESS or RUNNING, then returns that value.
      • If we exhaust all the children, return FAILURE.
  • LatchedSelector

    • Runs to each child until one of them returns SUCCESS or RUNNING, then returns that value.
      • If we exhaust all the children, return FAILURE.
      • If a child returns RUNNING, subsequent runs start at that child.
  • Sequence

    • Runs each child until one of the returns FAILURE, or RUNNING, then returns that value.
    • If all children return SUCCESS, return SUCCESS.
  • LatchedSequence

    • Runs each child until one of the returns FAILURE, or RUNNING, then returns that value.
    • If all children return SUCCESS, return SUCCESS.
    • If a child returns RUNNING, subsequent runs start at that child.
  • IfElse

    • Accepts a conditional function a consequent node, and an optional alternative node.
    • If conditional(state) returns true, will return the result of activating the consequent node.
    • If conditional(state) returns false, will return the result of activating the alternative node, if one is provided.
    • If conditional(state) returns false, will return FAILURE if no alternative node is provided.

Decorators

Decorators intercept and can modify the event sent to or the result from the child.

  • Not

    • Returns 'FAILURE' when the child returns 'SUCCESS', and vice-versa
  • RepeatWhen

    • Repeats the child when an evaluation function returns true.
  • RepeatOnResult

    • Repeats the child if it returns the specified status.
  • ResultSwap

    • Allows you to swap one result of a child node for another.
    • For example, you can use this to mask FAILURE as SUCCESS.

Base Classes

  • Base

    • The base of all nodes.
  • Composite

    • The base class for all nodes which have children.
  • Decorator

    • The base class for decorators.
    • Can only have one child.

Inspiration and Further Reading

The following are sources used when designing this library

Unread

Name

Blueshell is named for a Skroderider from the novel A Fire Upon the Deep by Vernor Vinge. Skroderiders are intelligent plants (trees) that use mechanical constructs to give them locomotion and short-term memory.

In other words, Blueshell is an intelligent tree. Or a tree with behavior. Get it?

Keywords

FAQs

Package last updated on 08 Dec 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc