Description Usage Format Examples
Has methods for all function arguments of astar.
1 |
An object of class R6ClassGenerator
of length 24.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | nodes <- list(
A = c(B = 100, C = 20),
C = c(D = 20),
D = c(B = 20)
)
Searcher <- R6::R6Class(
"Searcher",
inherit = AStar,
public = list(
neighbors = function(node) names(nodes[[node]]),
cost_estimate = function(node, goal) 1,
edge_distance = function(src, dst) nodes[[src]][dst],
is_goal_reached = function(node, goal) identical(node, goal)
)
)
searcher <- Searcher$new()
path <- searcher$run('A', 'B')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.