X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=extra%2Fpath-finding%2Fpath-finding-docs.factor;h=8d8b1c07980aeb86ccf21b30e81f86dde20ccb31;hp=e94a223ea7da7a33a0e31992c41ff7d87fa61284;hb=6d4293b5822d769619f66e46e64b704ddfe41b43;hpb=b7bb69b178712e9d135362ebd6efa69c9b8371ba diff --git a/extra/path-finding/path-finding-docs.factor b/extra/path-finding/path-finding-docs.factor index e94a223ea7..8d8b1c0798 100644 --- a/extra/path-finding/path-finding-docs.factor +++ b/extra/path-finding/path-finding-docs.factor @@ -7,7 +7,7 @@ IN: path-finding HELP: astar { $description "This tuple must be subclassed and its method " { $link cost } ", " - { $link heuristic } ", and " { $link neighbours } " must be implemented. " + { $link heuristic } ", and " { $link neighbors } " must be implemented. " "Alternatively, the " { $link } " word can be used to build a non-specialized version." } ; HELP: cost @@ -18,7 +18,7 @@ HELP: cost { "n" number } } { $description "Return the cost to go from " { $snippet "from" } " to " { $snippet "to" } ". " - { $snippet "to" } " is necessarily a neighbour of " { $snippet "from" } "." + { $snippet "to" } " is necessarily a neighbor of " { $snippet "from" } "." } ; HELP: heuristic @@ -29,10 +29,10 @@ HELP: heuristic { "n" number } } { $description "Return the estimated (undervalued) cost to go from " { $snippet "from" } " to " { $snippet "to" } ". " - { $snippet "from" } " and " { $snippet "to" } " are not necessarily neighbours." + { $snippet "from" } " and " { $snippet "to" } " are not necessarily neighbors." } ; -HELP: neighbours +HELP: neighbors { $values { "node" "a node" } { "astar" "an instance of a subclassed " { $link astar } " tuple" } @@ -42,25 +42,25 @@ HELP: neighbours HELP: { $values - { "neighbours" { $quotation ( node -- seq ) } } + { "neighbors" { $quotation ( node -- seq ) } } { "cost" { $quotation ( from to -- cost ) } } { "heuristic" { $quotation ( pos target -- cost ) } } { "astar" astar } } { $description "Build an astar object from the given quotations. The " - { $snippet "neighbours" } " one builds the list of neighbours. The " + { $snippet "neighbors" } " one builds the list of neighbours. The " { $snippet "cost" } " and " { $snippet "heuristic" } " ones represent " - "respectively the cost for transitioning from a node to one of its neighbour, " + "respectively the cost for transitioning from a node to one of its neighbor, " "and the underestimated cost for going from a node to the target. This solution " "may not be as efficient as subclassing the " { $link astar } " tuple." } ; HELP: { $values - { "neighbours" assoc } + { "neighbors" assoc } { "astar" astar } } -{ $description "Build an astar object from the " { $snippet "neighbours" } " assoc. " +{ $description "Build an astar object from the " { $snippet "neighbors" } " assoc. " "When used with " { $link find-path } ", this astar tuple will use the breadth-first search (BFS) " "path finding algorithm which is a particular case of the general A* algorithm." } ; @@ -100,7 +100,7 @@ HELP: considered ARTICLE: "path-finding" "Path finding using the A* algorithm" "The " { $vocab-link "path-finding" } " vocabulary implements a graph search algorithm for finding the least-cost path from one node to another using the A* algorithm." $nl -"The " { $link astar } " tuple may be derived from and its " { $link cost } ", " { $link heuristic } ", and " { $link neighbours } " methods overwritten, or the " { $link } " or " { $link } " words can be used to build a new tuple." $nl +"The " { $link astar } " tuple may be derived from and its " { $link cost } ", " { $link heuristic } ", and " { $link neighbors } " methods overwritten, or the " { $link } " or " { $link } " words can be used to build a new tuple." $nl "Make an A* object:" { $subsections } "Find a path between nodes:"