astar

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APlanner

type APlanner struct {
	// contains filtered or unexported fields
}

APlanner represent a planner using the A* algorithm.

func NewAPlanner

func NewAPlanner(actuators []actuators.Actuator, config common.Config) *APlanner

NewAPlanner initializes a new planner.

func (APlanner) CreatePlan

func (p APlanner) CreatePlan(current common.State, desired common.State, profiles map[string]common.Profile) []planner.Action

func (APlanner) ExecutePlan

func (p APlanner) ExecutePlan(state common.State, plan []planner.Action)

func (APlanner) Stop

func (p APlanner) Stop()

func (APlanner) TriggerEffect

func (p APlanner) TriggerEffect(current common.State, profiles map[string]common.Profile)

type Item

type Item struct {
	// contains filtered or unexported fields
}

Item represents an entity in the queue.

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node within a state graph.

func (*Node) StringRepresentation added in v0.2.0

func (state *Node) StringRepresentation() string

StringRepresentation generates a representation of the node's value.

type PriorityQueue

type PriorityQueue []*Item

PriorityQueue is a min priority queue.

func (PriorityQueue) Len

func (queue PriorityQueue) Len() int

Len returns the length of the queue.

func (PriorityQueue) Less

func (queue PriorityQueue) Less(i, j int) bool

Less determines an item with the lowest priority.

func (*PriorityQueue) Pop

func (queue *PriorityQueue) Pop() interface{}

Pop returns item with the lowest priority from the queue.

func (*PriorityQueue) Push

func (queue *PriorityQueue) Push(x interface{})

Push adds an item to the queue.

func (PriorityQueue) Swap

func (queue PriorityQueue) Swap(i, j int)

Swap swaps to items in the queue.

Jump to

Keyboard shortcuts

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