【文件属性】:
文件名称:behave:Python 中的行为树实现
文件大小:7KB
文件格式:ZIP
更新时间:2021-06-06 23:10:30
Python
行为:Python 中的行为树实现
使用behave ,你可以定义一个这样的行为树:
tree = (
is_greater_than_10 >> wow_large_number
| is_between_0_and_10 >> count_from_1
| failer * repeat(3) * doomed
)
bb = tree.blackboard(10)
while bb.tick() == RUNNING:
pass
从行为导入:
from behave import condition, action, FAILURE
定义条件节点
条件由函数定义,返回一个bool值。 该函数可以接受任意数量的参数。
@condition
def is_greater_than_10(x):
return x > 10
@conditi
【文件预览】:
behave-master
----test()
--------test_tree_grammar.py(1KB)
--------__init__.py(0B)
--------test_nodes.py(6KB)
----behave()
--------helper.py(1KB)
--------__init__.py(231B)
--------core.py(9KB)
--------decorator.py(938B)
----.gitignore(11B)
----readme.md(5KB)