go_behavior_tree

package module
v0.0.0-...-2536434 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2025 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-behavior-tree

golang behavior tree implementation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DoFuncDefault = ""
	DoFuncSuccess = "success"
	DoFuncFailure = "failure"
)

Functions

func DefaultDoFunc

func DefaultDoFunc(n *Node) (behaviortree.Status, error)

func DefaultDoFuncFailure

func DefaultDoFuncFailure(n *Node) (behaviortree.Status, error)

func DefaultDoFuncSuccess

func DefaultDoFuncSuccess(n *Node) (behaviortree.Status, error)

func DoFuncRegister

func DoFuncRegister(doFunc DoFunc)

func TickAll

func TickAll(n *Node) behaviortree.Tick

func TickRepeatUntilSuccessSequence

func TickRepeatUntilSuccessSequence(n *Node) behaviortree.Tick

func TickSelector

func TickSelector(n *Node) behaviortree.Tick

func TickSequence

func TickSequence(n *Node) behaviortree.Tick

Types

type DoFunc

type DoFunc func(n *Node) (behaviortree.Status, error)

type FindNode

type FindNode struct {
	Name string
	Path []int
}

type Node

type Node struct {
	DoFunc             DoFunc                 `json:"-"`
	Tick               behaviortree.Tick      `json:"-"`
	Error              error                  `json:"-"`
	ID                 string                 `json:"id,omitempty"`
	PreCheckExpression string                 `json:"pre_check_expression,omitempty"`
	DoFuncName         string                 `json:"do_func_name,omitempty"`
	TickType           TickType               `json:"tick_type,omitempty"`
	Name               string                 `json:"name,omitempty"`
	Alias              string                 `json:"alias,omitempty"`
	Path               []int                  `json:"path,omitempty"`
	Children           []*Node                `json:"children,omitempty"`
	Output             []string               `json:"output,omitempty"`
	Status             behaviortree.Status    `json:"status,omitempty"`
	Deprecated         bool                   `json:"deprecated,omitempty"`
	LocalBlackboard    map[string]interface{} `json:"local_blackboard,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) Dump

func (n *Node) Dump()

func (*Node) Find

func (n *Node) Find(req FindNode) (*Node, error)

func (*Node) FindCurrentTickNode

func (n *Node) FindCurrentTickNode() (*Node, error)

func (*Node) GetBTNodes

func (n *Node) GetBTNodes() []behaviortree.Node

func (*Node) GetBlackboard

func (n *Node) GetBlackboard() interface{}

func (*Node) GetDoFunc

func (n *Node) GetDoFunc() DoFunc

func (*Node) GetLocalBlackboard

func (n *Node) GetLocalBlackboard(key string) interface{}

func (*Node) GetNodeInstance

func (n *Node) GetNodeInstance() *NodeInstance

func (*Node) GetTick

func (n *Node) GetTick() (behaviortree.Tick, error)

func (*Node) IsDone

func (n *Node) IsDone() bool

func (*Node) IsRoot

func (n *Node) IsRoot() bool

func (*Node) PreRunCheck

func (n *Node) PreRunCheck() bool

func (*Node) PrintTreePath

func (n *Node) PrintTreePath()

func (*Node) PushOutput

func (n *Node) PushOutput(output string)

func (*Node) SetLocalBlackboard

func (n *Node) SetLocalBlackboard(key string, value interface{})

type NodeInstance

type NodeInstance struct {
	ID          string      `json:"id,omitempty"`
	Root        *Node       `json:"root"`
	Blackboard  interface{} `json:"blackboard"`
	CurrentPath []int       `json:"current_path"`
	// contains filtered or unexported fields
}

func (*NodeInstance) BuildBehaviorTree

func (ni *NodeInstance) BuildBehaviorTree() error

func (*NodeInstance) Context

func (ni *NodeInstance) Context() context.Context

func (*NodeInstance) IsDone

func (ni *NodeInstance) IsDone() bool

func (*NodeInstance) JumpOver

func (ni *NodeInstance) JumpOver(req FindNode) error

func (*NodeInstance) Marshal

func (ni *NodeInstance) Marshal() ([]byte, error)

func (*NodeInstance) PrintTreePath

func (ni *NodeInstance) PrintTreePath()

func (*NodeInstance) Retry

func (ni *NodeInstance) Retry() error

func (*NodeInstance) SetDumpFunc

func (ni *NodeInstance) SetDumpFunc(fn func(ctx context.Context, n *Node) error)

func (*NodeInstance) Tick

func (ni *NodeInstance) Tick() (behaviortree.Status, error)

func (*NodeInstance) WithContext

func (ni *NodeInstance) WithContext(ctx context.Context)

type TickType

type TickType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址