MIT License

项目介绍

Sollimann/bonsai 是一个托管在 GitHub 上的开源项目,主要使用 Rust 编写,采用 MIT License 许可证,目前获得 1.1k 个 Star、42 次 Fork。

仓库全名
Sollimann/bonsai
开源许可证
MIT License
Star 数
1.1k
Fork 数
42
未关闭 Issue
8

README 摘要

Bonsai 盆栽 Rust implementation of Behavior Trees Contents Quick intro to Behavior Trees Concepts Examples Development Guide Kanban Board Honorable Mentions Using Bonsai Rust Bonsai is available on crates.io. The recommended way to use it is to add a line into your Cargo.toml such as: Python Bonsai is available on PyPI as bonsai-bt: See bonsai-py/ for examples. Example of use See Examples folder. What is a Behavior…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bonsai 用什么语言开发?

主要使用 Rust 编写,采用 MIT License 许可证,目前有 1.1k 个 Star。

bonsai 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bonsai 的源码?

可以直接克隆仓库:git clone https://github.com/Sollimann/bonsai.git,默认分支为 main;安装与运行步骤见仓库 README。

bonsai 最近还在维护吗?

仓库最近一次更新为 9月22日,当前有 8 个未关闭 Issue;Star 数为 1.1k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Rust implementation of behavior trees for deterministic AI (now with Python bindings)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1192
价值分
673
活跃状态
活跃

语言占比

HTML
Makefile
Python
Rust
Shell

README

Bonsai 盆栽

Rust implementation of Behavior Trees

Build Status Bonsai crate PyPI minimum rustc 1.72 Docs codecov Maintenance GitHub pull-requests GitHub pull-requests closed ViewCount License: MIT

Contents

Using Bonsai

Rust

Bonsai is available on crates.io. The recommended way to use it is to add a line into your Cargo.toml such as:

[dependencies]
bonsai-bt = "*"

Python

Bonsai is available on PyPI as bonsai-bt:

pip install bonsai-bt

See bonsai-py/ for examples.

Example of use

See Examples folder.

What is a Behavior Tree?

A Behavior Tree (BT) is a data structure in which we can set the rules of how certain behavior’s can occur, and the order in which they would execute. BTs are a very efficient way of creating complex systems that are both modular and reactive. These properties are crucial in many applications, which has led to the spread of BT from computer game programming to many branches of AI and Robotics.

How to use a Behavior tree?

A Behavior Tree forms a tree structure where each node represents a process. When the process terminates, it signals Success or Failure. This can then be used by the parent node to select the next process. A signal Running is used to tell the process is not done yet.

For example, if you have a state A and a state B:

  • Move from state A to state B if A succeeds: Sequence([A, B])
  • Try A first and then try B if A fails: Select([A, B])
  • If condition succeedes do A, else do B : If(condition, A, B)
  • If A succeeds, return failure (and vice-versa): Invert(A)
  • Force a child to succeed regardless of its result: AlwaysSucceed(A)
  • Run a child, but fail it if it stays Running longer than a limit: Timeout(seconds, A)
  • Do A, B repeatedly while LoopCondition runs: While(LoopCondition, [A, B]). Checks condition node between nodes A, B.
  • Do A, B forever: While(WaitForever, [A, B])
  • Do A, B repeatedly while LoopCondition runs: WhileAll(LoopCondition, [A, B]). After All nodes A, B are completed successfully, check the condition node.
  • Run A and B in parallell and wait for both to succeed: WhenAll([A, B])
  • Run A and B in parallell and wait for any to succeed: WhenAny([A, B])
  • Run A and B in parallell and wait for any to complete regardless of success or failure: Race([A, B])
  • Run A and B in parallell, but A has to succeed before B: After([A, B])

See the Behavior enum for more information.

Calling long-running tasks in behavior tree

To make sure that the behavior tree is always responsive, it is important that the actions that are created executes instantly so that they do not block the tree traversal. If you have long-running tasks/functions that can take seconds or minutes to execute - either async or sync - then we can dispatch those jobs into background threads, and get status of the task through a channel.

see async drone example in the /examples folder for more details.

评论

暂无评论