tscommons-esm-algorithms 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/classes/astar-maze-search.d.mts +18 -0
  2. package/dist/classes/astar-maze-search.mjs +134 -0
  3. package/dist/classes/astar-maze-search.mjs.map +1 -0
  4. package/dist/classes/astar-search.d.mts +17 -0
  5. package/dist/classes/astar-search.mjs +32 -0
  6. package/dist/classes/astar-search.mjs.map +1 -0
  7. package/dist/classes/binary-winner-mini-max.d.mts +25 -0
  8. package/dist/classes/binary-winner-mini-max.mjs +100 -0
  9. package/dist/classes/binary-winner-mini-max.mjs.map +1 -0
  10. package/dist/classes/bredth-first-search.d.mts +5 -0
  11. package/dist/classes/bredth-first-search.mjs +7 -0
  12. package/dist/classes/bredth-first-search.mjs.map +1 -0
  13. package/dist/classes/constraint-satisfaction.d.mts +52 -0
  14. package/dist/classes/constraint-satisfaction.mjs +314 -0
  15. package/dist/classes/constraint-satisfaction.mjs.map +1 -0
  16. package/dist/classes/depth-first-search.d.mts +5 -0
  17. package/dist/classes/depth-first-search.mjs +7 -0
  18. package/dist/classes/depth-first-search.mjs.map +1 -0
  19. package/dist/classes/greedy-best-first-search.d.mts +6 -0
  20. package/dist/classes/greedy-best-first-search.mjs +20 -0
  21. package/dist/classes/greedy-best-first-search.mjs.map +1 -0
  22. package/dist/classes/hill-climb-local-search.d.mts +18 -0
  23. package/dist/classes/hill-climb-local-search.mjs +60 -0
  24. package/dist/classes/hill-climb-local-search.mjs.map +1 -0
  25. package/dist/classes/local-search.d.mts +8 -0
  26. package/dist/classes/local-search.mjs +29 -0
  27. package/dist/classes/local-search.mjs.map +1 -0
  28. package/dist/classes/random-restart.d.mts +11 -0
  29. package/dist/classes/random-restart.mjs +17 -0
  30. package/dist/classes/random-restart.mjs.map +1 -0
  31. package/dist/classes/search.d.mts +23 -0
  32. package/dist/classes/search.mjs +107 -0
  33. package/dist/classes/search.mjs.map +1 -0
  34. package/dist/enums/ebinary-player.d.mts +4 -0
  35. package/dist/enums/ebinary-player.mjs +6 -0
  36. package/dist/enums/ebinary-player.mjs.map +1 -0
  37. package/dist/enums/elocal-search-orientation.d.mts +4 -0
  38. package/dist/enums/elocal-search-orientation.mjs +6 -0
  39. package/dist/enums/elocal-search-orientation.mjs.map +1 -0
  40. package/dist/enums/emaze-heuristic.d.mts +4 -0
  41. package/dist/enums/emaze-heuristic.mjs +6 -0
  42. package/dist/enums/emaze-heuristic.mjs.map +1 -0
  43. package/dist/index.d.mts +18 -0
  44. package/dist/index.mjs +16 -0
  45. package/dist/index.mjs.map +1 -0
  46. package/dist/types/tmaze-search-node.d.mts +10 -0
  47. package/dist/types/tmaze-search-node.mjs +2 -0
  48. package/dist/types/tmaze-search-node.mjs.map +1 -0
  49. package/dist/types/tsearch-node.d.mts +3 -0
  50. package/dist/types/tsearch-node.mjs +2 -0
  51. package/dist/types/tsearch-node.mjs.map +1 -0
  52. package/dist/types/tstart-with-score.d.mts +4 -0
  53. package/dist/types/tstart-with-score.mjs +2 -0
  54. package/dist/types/tstart-with-score.mjs.map +1 -0
  55. package/package.json +30 -0
@@ -0,0 +1,107 @@
1
+ import { commonsArrayShuffle } from 'tscommons-esm-core';
2
+ export function commonsAlgorithmDeInternalise(node) {
3
+ const clone = { ...node };
4
+ delete clone['parent'];
5
+ return clone;
6
+ }
7
+ export class CommonsAlgorithmSearch {
8
+ actions;
9
+ shuffle;
10
+ frontier = [];
11
+ explored = [];
12
+ constructor(actions, shuffle = true) {
13
+ this.actions = actions;
14
+ this.shuffle = shuffle;
15
+ }
16
+ inArray(search, array) {
17
+ for (const n of array)
18
+ if (this.isEqual(search, n))
19
+ return true;
20
+ return false;
21
+ }
22
+ inFrontier(node) {
23
+ return this.inArray(node, this.frontier);
24
+ }
25
+ inExplored(node) {
26
+ return this.inArray(node, this.explored);
27
+ }
28
+ transition(node, action) {
29
+ const applied = this.applyActionIfPossible(node, action);
30
+ if (!applied)
31
+ return undefined;
32
+ return {
33
+ ...applied,
34
+ parent: node,
35
+ action: action
36
+ };
37
+ }
38
+ transitions(node) {
39
+ const potentials = [];
40
+ const actions = [...this.actions];
41
+ if (this.shuffle)
42
+ commonsArrayShuffle(actions);
43
+ for (const action of actions) {
44
+ const attempt = this.transition(node, action);
45
+ if (!attempt)
46
+ continue;
47
+ potentials.push({
48
+ ...attempt,
49
+ action: action,
50
+ parent: node
51
+ });
52
+ }
53
+ return potentials;
54
+ }
55
+ computeRoute(start, progressCallback, progressBlockSize = 10) {
56
+ this.frontier.push({
57
+ ...start,
58
+ parent: undefined,
59
+ action: undefined
60
+ });
61
+ let next;
62
+ let i = 0;
63
+ while (true) {
64
+ if (progressCallback) {
65
+ if ((i++ % progressBlockSize) === 0)
66
+ progressCallback(this.frontier.length, this.explored.length);
67
+ }
68
+ next = this.next;
69
+ if (!next)
70
+ return undefined;
71
+ if (this.isGoal(next))
72
+ break;
73
+ // destructuring seems to be more efficient than clone and delete
74
+ const { parent, action, ...clone } = { ...next, action: undefined, parent: undefined };
75
+ this.explored.push(clone);
76
+ for (const n of this.transitions(next)) {
77
+ if (this.inFrontier(n))
78
+ continue;
79
+ if (this.inExplored(n))
80
+ continue;
81
+ this.frontier.push(n);
82
+ }
83
+ }
84
+ if (!next)
85
+ return undefined;
86
+ // traverse backwards
87
+ const route = [];
88
+ let nextAction;
89
+ while (next) {
90
+ const clone = commonsAlgorithmDeInternalise(next);
91
+ route.push({
92
+ ...clone,
93
+ action: nextAction
94
+ });
95
+ nextAction = next.action;
96
+ next = next.parent;
97
+ }
98
+ return route.reverse();
99
+ }
100
+ listExplored() {
101
+ return [...this.explored]
102
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
103
+ // @ts-expect-error
104
+ .map((e) => commonsAlgorithmDeInternalise(e));
105
+ }
106
+ }
107
+ //# sourceMappingURL=search.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.mjs","sourceRoot":"","sources":["../../src/classes/search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inaryPlayer["A"] = "a";
4
+ ECommonsAlgorithmBinaryPlayer["B"] = "b";
5
+ })(ECommonsAlgorithmBinaryPlayer || (ECommonsAlgorithmBinaryPlayer = {}));
6
+ //# sourceMappingURL=ebinary-player.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ebinary-player.mjs","sourceRoot":"","sources":["../../src/enums/ebinary-player.mts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,wCAAO,CAAA;IACP,wCAAO,CAAA;AACT,CAAC,EAHW,6BAA6B,KAA7B,6BAA6B,QAGxC"}
@@ -0,0 +1,4 @@
1
+ export declare enum ECommonsAlgorithmOrientation {
2
+ MAXIMUM = "maximum",
3
+ MINIMUM = "minimum"
4
+ }
@@ -0,0 +1,6 @@
1
+ export var ECommonsAlgorithmOrientation;
2
+ (function (ECommonsAlgorithmOrientation) {
3
+ ECommonsAlgorithmOrientation["MAXIMUM"] = "maximum";
4
+ ECommonsAlgorithmOrientation["MINIMUM"] = "minimum";
5
+ })(ECommonsAlgorithmOrientation || (ECommonsAlgorithmOrientation = {}));
6
+ //# sourceMappingURL=elocal-search-orientation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elocal-search-orientation.mjs","sourceRoot":"","sources":["../../src/enums/elocal-search-orientation.mts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,mDAAmB,CAAA;AACrB,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC"}
@@ -0,0 +1,4 @@
1
+ export declare enum ECommonsAlgorithmMazeHeuristic {
2
+ MANHATTEN = "manhatten",
3
+ PYTHAGORAS = "pythagoras"
4
+ }
@@ -0,0 +1,6 @@
1
+ export var ECommonsAlgorithmMazeHeuristic;
2
+ (function (ECommonsAlgorithmMazeHeuristic) {
3
+ ECommonsAlgorithmMazeHeuristic["MANHATTEN"] = "manhatten";
4
+ ECommonsAlgorithmMazeHeuristic["PYTHAGORAS"] = "pythagoras";
5
+ })(ECommonsAlgorithmMazeHeuristic || (ECommonsAlgorithmMazeHeuristic = {}));
6
+ //# sourceMappingURL=emaze-heuristic.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emaze-heuristic.mjs","sourceRoot":"","sources":["../../src/enums/emaze-heuristic.mts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACxC,yDAAuB,CAAA;IACvB,2DAAyB,CAAA;AAC3B,CAAC,EAHW,8BAA8B,KAA9B,8BAA8B,QAGzC"}
@@ -0,0 +1,18 @@
1
+ import { CommonsAlgorithmAStarMazeSearch } from './classes/astar-maze-search.mjs';
2
+ import { CommonsAlgorithmGreedyBestFirstSearch } from './classes/greedy-best-first-search.mjs';
3
+ import { TCommonsAlgorithmInternalNode, commonsAlgorithmDeInternalise, CommonsAlgorithmSearch } from './classes/search.mjs';
4
+ import { CommonsAlgorithmRandomRestartSearch } from './classes/random-restart.mjs';
5
+ import { CommonsAlgorithmHillClimbLocalSearch, CommonsAlgorithmSteepestHillClimbLocalSearch, CommonsAlgorithmStochasticHillClimbLocalSearch, CommonsAlgorithmFirstChoiceHillClimbLocalSearch } from './classes/hill-climb-local-search.mjs';
6
+ import { CommonsAlgorithmBredthFirstSearch } from './classes/bredth-first-search.mjs';
7
+ import { TCommonsAlgorithmInternalStepCostNode, CommonsAlgorithmAStarSearch } from './classes/astar-search.mjs';
8
+ import { CommonsAlgorithmLocalSearch } from './classes/local-search.mjs';
9
+ import { TCommonsAlgorithmBinaryWinnerMiniMaxPlayer, TCommonsAlgorithmBinaryPlay, CommonsAlgorithmBinaryWinnerMiniMax } from './classes/binary-winner-mini-max.mjs';
10
+ import { CommonsAlgorithmDepthFirstSearch } from './classes/depth-first-search.mjs';
11
+ import { CommonsAlgorithmConstraintSatisfactionNode, CommonsAlgorithmConstraintSatisfactionEdge, CommonsAlgorithmConstraintSatisfactionGraph } from './classes/constraint-satisfaction.mjs';
12
+ import { ECommonsAlgorithmBinaryPlayer } from './enums/ebinary-player.mjs';
13
+ import { ECommonsAlgorithmOrientation } from './enums/elocal-search-orientation.mjs';
14
+ import { ECommonsAlgorithmMazeHeuristic } from './enums/emaze-heuristic.mjs';
15
+ import { TCommonsAlgorithmSearchNode } from './types/tsearch-node.mjs';
16
+ import { TCommonsAlgorithmStateWithScore } from './types/tstart-with-score.mjs';
17
+ import { TCommonsAlgorithmSearchDimensionMazeNode, TCommonsAlgorithmSearchDimensionMazeCell } from './types/tmaze-search-node.mjs';
18
+ export { CommonsAlgorithmAStarMazeSearch, CommonsAlgorithmGreedyBestFirstSearch, TCommonsAlgorithmInternalNode, commonsAlgorithmDeInternalise, CommonsAlgorithmSearch, CommonsAlgorithmRandomRestartSearch, CommonsAlgorithmHillClimbLocalSearch, CommonsAlgorithmSteepestHillClimbLocalSearch, CommonsAlgorithmStochasticHillClimbLocalSearch, CommonsAlgorithmFirstChoiceHillClimbLocalSearch, CommonsAlgorithmBredthFirstSearch, TCommonsAlgorithmInternalStepCostNode, CommonsAlgorithmAStarSearch, CommonsAlgorithmLocalSearch, TCommonsAlgorithmBinaryWinnerMiniMaxPlayer, TCommonsAlgorithmBinaryPlay, CommonsAlgorithmBinaryWinnerMiniMax, CommonsAlgorithmDepthFirstSearch, CommonsAlgorithmConstraintSatisfactionNode, CommonsAlgorithmConstraintSatisfactionEdge, CommonsAlgorithmConstraintSatisfactionGraph, ECommonsAlgorithmBinaryPlayer, ECommonsAlgorithmOrientation, ECommonsAlgorithmMazeHeuristic, TCommonsAlgorithmSearchNode, TCommonsAlgorithmStateWithScore, TCommonsAlgorithmSearchDimensionMazeNode, TCommonsAlgorithmSearchDimensionMazeCell };
package/dist/index.mjs ADDED
@@ -0,0 +1,16 @@
1
+ import { CommonsAlgorithmAStarMazeSearch } from './classes/astar-maze-search.mjs';
2
+ import { CommonsAlgorithmGreedyBestFirstSearch } from './classes/greedy-best-first-search.mjs';
3
+ import { commonsAlgorithmDeInternalise, CommonsAlgorithmSearch } from './classes/search.mjs';
4
+ import { CommonsAlgorithmRandomRestartSearch } from './classes/random-restart.mjs';
5
+ import { CommonsAlgorithmHillClimbLocalSearch, CommonsAlgorithmSteepestHillClimbLocalSearch, CommonsAlgorithmStochasticHillClimbLocalSearch, CommonsAlgorithmFirstChoiceHillClimbLocalSearch } from './classes/hill-climb-local-search.mjs';
6
+ import { CommonsAlgorithmBredthFirstSearch } from './classes/bredth-first-search.mjs';
7
+ import { CommonsAlgorithmAStarSearch } from './classes/astar-search.mjs';
8
+ import { CommonsAlgorithmLocalSearch } from './classes/local-search.mjs';
9
+ import { CommonsAlgorithmBinaryWinnerMiniMax } from './classes/binary-winner-mini-max.mjs';
10
+ import { CommonsAlgorithmDepthFirstSearch } from './classes/depth-first-search.mjs';
11
+ import { CommonsAlgorithmConstraintSatisfactionNode, CommonsAlgorithmConstraintSatisfactionEdge, CommonsAlgorithmConstraintSatisfactionGraph } from './classes/constraint-satisfaction.mjs';
12
+ import { ECommonsAlgorithmBinaryPlayer } from './enums/ebinary-player.mjs';
13
+ import { ECommonsAlgorithmOrientation } from './enums/elocal-search-orientation.mjs';
14
+ import { ECommonsAlgorithmMazeHeuristic } from './enums/emaze-heuristic.mjs';
15
+ export { CommonsAlgorithmAStarMazeSearch, CommonsAlgorithmGreedyBestFirstSearch, commonsAlgorithmDeInternalise, CommonsAlgorithmSearch, CommonsAlgorithmRandomRestartSearch, CommonsAlgorithmHillClimbLocalSearch, CommonsAlgorithmSteepestHillClimbLocalSearch, CommonsAlgorithmStochasticHillClimbLocalSearch, CommonsAlgorithmFirstChoiceHillClimbLocalSearch, CommonsAlgorithmBredthFirstSearch, CommonsAlgorithmAStarSearch, CommonsAlgorithmLocalSearch, CommonsAlgorithmBinaryWinnerMiniMax, CommonsAlgorithmDepthFirstSearch, CommonsAlgorithmConstraintSatisfactionNode, CommonsAlgorithmConstraintSatisfactionEdge, CommonsAlgorithmConstraintSatisfactionGraph, ECommonsAlgorithmBinaryPlayer, ECommonsAlgorithmOrientation, ECommonsAlgorithmMazeHeuristic };
16
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,qCAAqC,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAiC,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC5H,OAAO,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EACL,oCAAoC,EACpC,4CAA4C,EAC5C,8CAA8C,EAC9C,+CAA+C,EAChD,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAyC,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAChH,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAA2E,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AACpK,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,0CAA0C,EAAE,0CAA0C,EAAE,2CAA2C,EAAE,MAAM,uCAAuC,CAAC;AAC5L,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAI7E,OAAO,EACN,+BAA+B,EAC/B,qCAAqC,EAErC,6BAA6B,EAC7B,sBAAsB,EACtB,mCAAmC,EACnC,oCAAoC,EACpC,4CAA4C,EAC5C,8CAA8C,EAC9C,+CAA+C,EAC/C,iCAAiC,EAEjC,2BAA2B,EAC3B,2BAA2B,EAG3B,mCAAmC,EACnC,gCAAgC,EAChC,0CAA0C,EAC1C,0CAA0C,EAC1C,2CAA2C,EAC3C,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAK9B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { TCommonsAlgorithmSearchNode } from './tsearch-node.mjs';
2
+ export type TCommonsAlgorithmSearchDimensionMazeNode<DimT extends number[]> = TCommonsAlgorithmSearchNode<DimT> & {
3
+ coord: DimT;
4
+ };
5
+ export type TCommonsAlgorithmSearchDimensionMazeCell<DimT extends number[]> = {
6
+ coord: DimT;
7
+ visitable: boolean;
8
+ costToVisit?: number;
9
+ permittedActions?: DimT[];
10
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tmaze-search-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmaze-search-node.mjs","sourceRoot":"","sources":["../../src/types/tmaze-search-node.mts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export type TCommonsAlgorithmSearchNode<ActionT> = {
2
+ action: ActionT | undefined;
3
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tsearch-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsearch-node.mjs","sourceRoot":"","sources":["../../src/types/tsearch-node.mts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type TCommonsAlgorithmStateWithScore<StateT> = {
2
+ state: StateT;
3
+ score: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tstart-with-score.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tstart-with-score.mjs","sourceRoot":"","sources":["../../src/types/tstart-with-score.mts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "tscommons-esm-algorithms",
3
+ "version": "0.0.2",
4
+ "description": "",
5
+ "scripts": {
6
+ "tsc": "./node_modules/typescript/bin/tsc",
7
+ "preprepare": "rm -rf ./dist; php ~/Dev/etim.php src/ && npm run tsc",
8
+ "publish-major": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version major && npm install && npm publish && git add . && git commit -m 'publish'",
9
+ "publish-minor": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version minor && npm install && npm publish && git add . && git commit -m 'publish'",
10
+ "publish-patch": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version patch && npm install && npm publish && git add . && git commit -m 'publish'"
11
+ },
12
+ "main": "dist/index.mjs",
13
+ "types": "dist/index.d.mjs",
14
+ "type": "module",
15
+ "author": "Pete Morris",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@stylistic/eslint-plugin-ts": "^2.10.1",
19
+ "eslint-plugin-import": "^2.31.0",
20
+ "eslint-plugin-prefer-arrow-functions": "^3.4.1",
21
+ "typescript": "^5.6.3",
22
+ "typescript-eslint": "^8.14.0"
23
+ },
24
+ "files": [
25
+ "dist/**/*"
26
+ ],
27
+ "dependencies": {
28
+ "tscommons-esm-core": "^0.0.2"
29
+ }
30
+ }