astarsearch

package
v0.0.0-...-db2e5f8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: BSD-2-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package astarsearch provides A* search that figures out whether a solution exists or not

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AStarSearch

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

AStarSearch represents a search tree for A* Search and its frontier

func InitSearch

func InitSearch(initialState State) *AStarSearch

InitSearch initializes A* Search with a game state initialState where the solution is searched for

func (*AStarSearch) Search

func (aStar *AStarSearch) Search(veryEnd bool) (bool, interface{})

Search tries to find a goal state. If a soltuion exists, it returns true, otherwise it returns false

type State

type State interface {
	IsGoalState() (bool, interface{})
	GetEstimateToReachGoal() int
	GetSuccessorStates(bool) []State
	GetClean() interface{}
	String() string
}

State represents a state in A* Search

Jump to

Keyboard shortcuts

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