forked from TimMensch/javascript-astar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
66 lines (66 loc) · 4.77 KB
/
package.json
File metadata and controls
66 lines (66 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"_args": [
[
"github:timmensch/javascript-astar",
"D:\\QuickCharge\\SteelDragons"
]
],
"_from": "timmensch/javascript-astar",
"_id": "[email protected]",
"_inCache": true,
"_installable": true,
"_location": "/javascript-astar",
"_phantomChildren": {},
"_requested": {
"hosted": {
"directUrl": "https://raw.githubusercontent.com/timmensch/javascript-astar/master/package.json",
"gitUrl": "git://github.com/timmensch/javascript-astar.git",
"httpsUrl": "git+https://github.com/timmensch/javascript-astar.git",
"shortcut": "github:timmensch/javascript-astar",
"ssh": "[email protected]:timmensch/javascript-astar.git",
"sshUrl": "git+ssh://[email protected]/timmensch/javascript-astar.git",
"type": "github"
},
"name": null,
"raw": "github:timmensch/javascript-astar",
"rawSpec": "github:timmensch/javascript-astar",
"scope": null,
"spec": "github:timmensch/javascript-astar",
"type": "hosted"
},
"_requiredBy": [
"/"
],
"_resolved": "git://github.com/timmensch/javascript-astar.git#d7d325d3c4025d142d7fa61b714d9391a3661e26",
"_shasum": "95e3f961d66688bffa38272c59c83a041a8b6f13",
"_shrinkwrap": null,
"_spec": "github:timmensch/javascript-astar",
"_where": "D:\\QuickCharge\\SteelDragons",
"author": {
"name": "Brian Grinstead"
},
"bugs": {
"url": "https://github.com/bgrins/javascript-astar/issues"
},
"dependencies": {},
"description": "astar search algorithm in JavaScript",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-qunit": "~0.5.0"
},
"gitHead": "d7d325d3c4025d142d7fa61b714d9391a3661e26",
"homepage": "http://bgrins.github.io/javascript-astar",
"keywords": [],
"license": "MIT",
"main": "./astar.js",
"name": "javascript-astar",
"optionalDependencies": {},
"readme": "# javascript-astar\r\n\r\n## An implementation of the A* Search Algorithm in JavaScript\r\n\r\nSee a demo at http://www.briangrinstead.com/files/astar/\r\n\r\n## Sample Usage\r\n\r\nIf you want just the A* search code (not the demo visualization), use code like this http://gist.github.com/581352\r\n```js\r\n<script type='text/javascript' src='astar.js'></script>\r\n<script type='text/javascript'>\r\n\tvar graph = new Graph([\r\n\t\t[1,1,1,1],\r\n\t\t[0,1,1,0],\r\n\t\t[0,0,1,1]\r\n\t]);\r\n\tvar start = graph.grid[0][0];\r\n\tvar end = graph.grid[1][2];\r\n\tvar result = astar.search(graph, start, end);\r\n\t// result is an array containing the shortest path\r\n\tvar graphDiagonal = new Graph([\r\n\t\t[1,1,1,1],\r\n\t\t[0,1,1,0],\r\n\t\t[0,0,1,1]\r\n\t], { diagonal: true });\r\n\t\r\n\tvar start = graphDiagonal.grid[0][0];\r\n\tvar end = graphDiagonal.grid[1][2];\r\n\tvar resultWithDiagonals = astar.search(graphDiagonal, start, end, { heuristic: astar.heuristics.diagonal });\r\n\t// Weight can easily be added by increasing the values within the graph, and where 0 is infinite (a wall)\r\n\tvar graphWithWeight = new Graph([\r\n\t\t[1,1,2,30],\r\n\t\t[0,4,1.3,0],\r\n\t\t[0,0,5,1]\r\n\t]);\r\n\tvar startWithWeight = graphWithWeight.grid[0][0];\r\n\tvar endWithWeight = graphWithWeight.grid[1][2];\r\n\tvar resultWithWeight = astar.search(graphWithWeight, startWithWeight, endWithWeight);\r\n\t// resultWithWeight is an array containing the shortest path taking into account the weight of a node\r\n</script>\r\n```\r\nA few notes about weight values:\r\n\r\n1. A weight of 0 denotes a wall.\r\n2. A weight cannot be negative.\r\n3. A weight cannot be between 0 and 1 (exclusive).\r\n4. A weight can contain decimal values (greater than 1).\r\n\r\n### Original (slower) implementation\r\n\r\nThe original version of the algorithm used a list, and was a bit clearer but much slower. It was based off the [original blog post](http://www.briangrinstead.com/blog/astar-search-algorithm-in-javascript). The code is available at: https://github.com/bgrins/javascript-astar/tree/0.0.1/original-implementation.\r\n\r\nThe newest version of the algorithm using a Binary Heap. It is quite faster than the original.\r\nhttp://www.briangrinstead.com/blog/astar-search-algorithm-in-javascript-updated\r\nBinary Heap taken from http://eloquentjavascript.net/appendix2.html (license: http://creativecommons.org/licenses/by/3.0/)\r\n\r\n\r\n## Running the test suite\r\n\r\n[](https://travis-ci.org/bgrins/javascript-astar)\r\n\r\nIf you don't have grunt installed, follow the [grunt getting started guide](http://gruntjs.com/getting-started) first.\r\n\r\nPull down the project, then run:\r\n\r\n\t\tnpm install\r\n\t\tgrunt\r\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/bgrins/javascript-astar.git"
},
"version": "0.4.1-qc2"
}