行为树与状态机

发布于 2024-11-24 00:52:03 字数 359 浏览 11 评论 0原文

我想实现一个复杂的分支逻辑 Android 业务应用程序,用作营销问卷工具,其中有很多问题,并根据用户的响应在问题之间进行分支。 我很困惑是将对话逻辑实现为 FSM 还是行为树。作者使用树来实现状态机。例如,在 Ian Millington 等人的Artificial Intelligence for Games 中,作者建议使用决策树来构建 FSM。然而,我认为 FSM 可以有闭包,例如在“发出警报”和“防御”之间进行转换将使其成为图形而不是树。我的第一个问题是树和状态机有什么区别?第二个问题是什么对我的应用程序来说是一个好的实现,管理高水平的分支复杂性?

结合决策树和状态机

I want to implement a complex branching logic Android business application to be used as a marketing questionaire tool with lots of questions and branching among them according to what the user responds.
I'm confused whether to implement the dialog logic as a FSM or a behavior tree. Authors have used trees to implement state machines. For example in Artificial Intelligence for Games By Ian Millington et al, the author suggests using decision tree for a FSM. However, I think that a FSM can have closures, for example having a transition between "raise alarm" and "defend" will make it a graph rather than a tree. My first question is what is the difference between a tree and a state machine ? The second one is what will be a good implementation for my app, manage the high level of branching complexity?

Combining Decision Tree and State Machine

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尛丟丟 2024-12-01 00:52:04

我认为根据定义,FSM 只有一个入口点,而行为树可以有多个输入。树是图,但图不是树。树是一种非循环图,其中叶子永远不会有多个父代。所以从这方面来说,该树更适合FSM。

无论如何,我想这种类型的模拟超出了 android api 的范围。因此,我会更多地关注 Java 中有哪些可用的工具。我曾经用Java做过一个机器学习研究项目。我最终实现了自定义树数据结构以促进多线程。

我希望这有帮助!

I think by definition, FSM have only one entry point, while behavior trees can have multiple inputs. A tree is a graph, but a graph is not a tree. A tree is an acyclic graph where leaves never have multiple parents. So in this regard, the tree is better suited for the FSM.

Anyways, I would imagine that this type of simulation is outside the scope of android api. Hence, I would be looking more at what kind of tools are available in Java. I once did a machine learning research project in Java. I ended up implementing a custom Tree data structure in order to facilitate multithreading.

I hope that helps!

ㄖ落Θ余辉 2024-12-01 00:52:04

行为树和决策树是两个不同的东西。行为树是面向目标和反应性的(更适合在类似游戏的环境中模拟代理或智能实体的决策),决策树是一个很好的工具,用于根据某个动作的效用来规范(和存储)决策。给定状态。
主要是,在第一种方法中,执行更加有状态(执行与树中的状态相关),而在后者中,执行更加无状态(整个树从根到叶进行评估,以便到达结论)。

也就是说,从您的描述来看,您似乎正在寻找一个基于规则的专家系统。

Behavior trees and Decision trees are two different things. Behavior trees are a goal oriented and reactive (suite more for simulating agents or smart entities decisions in a game like environment), and decision trees are a great tool for the specification (and storage) of decisions based on the utility of an action for a given state.
Mainly, in first approach the execution is more state-full ( the execution is tied to the state you are in the tree) and in the later is more state-less (the whole tree is evaluated root to leaf in order to arrive to a conclusion).

That said, from your description it seems that what you are looking is for an expert system, rule based.

烟雨扶苏 2024-12-01 00:52:04

FSM 是通过转换链接的状态图。对于复杂的fsm,由于复杂的转换而很难扩展。

对于行为树,每个节点都由其父节点管理,转换实际上隐式地存在于父/子关系中,因此更容易扩展现有的行为树。

源码和设计器可以参考https://github.com/TencentOpen/behaviac

FSM is a graph of states linked by transitions. for a complex fsm, it is difficult to extend due to complex transitions.

For behavior trees, each node is managed by its parent, the transition is in fact implicitly in the parent/child relationship, so it easier to extend an existing behavior tree.

you can refer to https://github.com/TencentOpen/behaviac for the source code and designer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文