@thi.ng/gp 0.4.30 → 0.4.32

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-11-30T22:27:37Z
3
+ - **Last updated**: 2022-12-20T16:33:11Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![gp](https://media.thi.ng/umbrella/banners-20220914/thing-gp.svg?37482bab)
3
+ # ![@thi.ng/gp](https://media.thi.ng/umbrella/banners-20220914/thing-gp.svg?37482bab)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/gp.svg)](https://www.npmjs.com/package/@thi.ng/gp)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/gp.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -22,7 +22,7 @@ This project is part of the
22
22
 
23
23
  ## About
24
24
 
25
- Genetic programming helpers & strategies (tree based & multi-expression programming).
25
+ Genetic programming helpers & strategies (tree based & multi-expression programming)
26
26
 
27
27
  This package does not (yet) provide a complete GP framework and is
28
28
  largely focused on the following operations:
@@ -79,11 +79,8 @@ ES module import:
79
79
 
80
80
  For Node.js REPL:
81
81
 
82
- ```text
83
- # with flag only for < v16
84
- node --experimental-repl-await
85
-
86
- > const gp = await import("@thi.ng/gp");
82
+ ```js
83
+ const gp = await import("@thi.ng/gp");
87
84
  ```
88
85
 
89
86
  Package sizes (brotli'd, pre-treeshake): ESM: 1.18 KB
@@ -117,7 +114,7 @@ TODO
117
114
 
118
115
  ## Authors
119
116
 
120
- Karsten Schmidt
117
+ - [Karsten Schmidt](https://thi.ng)
121
118
 
122
119
  If this project contributes to an academic publication, please cite it as:
123
120
 
@@ -132,4 +129,4 @@ If this project contributes to an academic publication, please cite it as:
132
129
 
133
130
  ## License
134
131
 
135
- &copy; 2019 - 2022 Karsten Schmidt // Apache Software License 2.0
132
+ &copy; 2019 - 2022 Karsten Schmidt // Apache License 2.0
package/api.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { Fn, Fn2 } from "@thi.ng/api";
2
2
  import type { IRandom } from "@thi.ng/random";
3
- export declare type GeneType = "term" | "op";
3
+ export type GeneType = "term" | "op";
4
4
  /**
5
5
  * Type alias for S-expression based AST
6
6
  */
7
- export declare type ASTNode<OP, T> = TerminalGene<T> | OpGene<OP, ASTNode<OP, T>>;
8
- export declare type MEPGene<OP, T> = TerminalGene<T> | OpGene<OP, number>;
9
- export declare type MEPChromosome<OP, T> = MEPGene<OP, T>[];
7
+ export type ASTNode<OP, T> = TerminalGene<T> | OpGene<OP, ASTNode<OP, T>>;
8
+ export type MEPGene<OP, T> = TerminalGene<T> | OpGene<OP, number>;
9
+ export type MEPChromosome<OP, T> = MEPGene<OP, T>[];
10
10
  export interface GPOpts<OP, T, ARGS> {
11
11
  /**
12
12
  * Terminal node generator. If probabilistic, the given PRNG MUST be
@@ -18,10 +18,10 @@ export interface GPOpts<OP, T, ARGS> {
18
18
  */
19
19
  ops: OpGenSpec<ARGS, OP>[];
20
20
  /**
21
- * Possibly seeded PRNG instance to be used for AST generation /
22
- * editing.
21
+ * Possibly seeded PRNG instance to be used for AST generation / editing.
23
22
  *
24
- * @defaultValue {@link @thi.ng/random#SYSTEM}
23
+ * @defaultValue
24
+ * [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html)
25
25
  */
26
26
  rnd?: IRandom;
27
27
  /**
package/ast.d.ts CHANGED
@@ -37,26 +37,26 @@ export declare class AST<OP, T> {
37
37
  */
38
38
  mutate(tree: ASTNode<OP, T>, maxDepth?: number): ASTNode<OP, T>;
39
39
  /**
40
- * Returns linearized/flat version of given AST as an array of
41
- * {@link @thi.ng/zipper#Location | zipper locations}.
40
+ * Returns linearized/flat version of given AST as an array of [zipper
41
+ * locations](https://docs.thi.ng/umbrella/zipper/classes/Location.html).
42
42
  *
43
43
  * @param tree -
44
44
  */
45
45
  linearizedAST(tree: ASTNode<OP, T>): Location<ASTNode<OP, T>>[];
46
46
  /**
47
- * Returns random {@link ASTNode} from given tree, using the user
48
- * provided PRNG (via `opts`) or {@link @thi.ng/random#SYSTEM}. The
49
- * returned value is a
50
- * {@link @thi.ng/zipper#Location | zipper location} of the selected
51
- * node.
47
+ * Returns random {@link ASTNode} from given tree, using the user provided
48
+ * PRNG (via `opts`) or
49
+ * [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
50
+ * The returned value is a [zipper
51
+ * location](https://docs.thi.ng/umbrella/zipper/classes/Location.html) of
52
+ * the selected node.
52
53
  *
53
54
  * @remarks
54
55
  * The actual `ASTNode` can be obtained via `.node`.
55
56
  *
56
- * Only nodes in the linearized index range `[min..max)` are
57
- * returned (default: entire tree range). Since the linear tree
58
- * length isn't known beforehand, `max` < 0 (default) is equivalent
59
- * to the linearized tree end.
57
+ * Only nodes in the linearized index range `[min..max)` are returned
58
+ * (default: entire tree range). Since the linear tree length isn't known
59
+ * beforehand, `max` < 0 (default) is equivalent to the linearized tree end.
60
60
  *
61
61
  * @param opts -
62
62
  * @param tree -
package/ast.js CHANGED
@@ -77,8 +77,8 @@ export class AST {
77
77
  }
78
78
  }
79
79
  /**
80
- * Returns linearized/flat version of given AST as an array of
81
- * {@link @thi.ng/zipper#Location | zipper locations}.
80
+ * Returns linearized/flat version of given AST as an array of [zipper
81
+ * locations](https://docs.thi.ng/umbrella/zipper/classes/Location.html).
82
82
  *
83
83
  * @param tree -
84
84
  */
@@ -88,19 +88,19 @@ export class AST {
88
88
  ];
89
89
  }
90
90
  /**
91
- * Returns random {@link ASTNode} from given tree, using the user
92
- * provided PRNG (via `opts`) or {@link @thi.ng/random#SYSTEM}. The
93
- * returned value is a
94
- * {@link @thi.ng/zipper#Location | zipper location} of the selected
95
- * node.
91
+ * Returns random {@link ASTNode} from given tree, using the user provided
92
+ * PRNG (via `opts`) or
93
+ * [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
94
+ * The returned value is a [zipper
95
+ * location](https://docs.thi.ng/umbrella/zipper/classes/Location.html) of
96
+ * the selected node.
96
97
  *
97
98
  * @remarks
98
99
  * The actual `ASTNode` can be obtained via `.node`.
99
100
  *
100
- * Only nodes in the linearized index range `[min..max)` are
101
- * returned (default: entire tree range). Since the linear tree
102
- * length isn't known beforehand, `max` < 0 (default) is equivalent
103
- * to the linearized tree end.
101
+ * Only nodes in the linearized index range `[min..max)` are returned
102
+ * (default: entire tree range). Since the linear tree length isn't known
103
+ * beforehand, `max` < 0 (default) is equivalent to the linearized tree end.
104
104
  *
105
105
  * @param opts -
106
106
  * @param tree -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/gp",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "description": "Genetic programming helpers & strategies (tree based & multi-expression programming)",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
@@ -34,20 +34,20 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1",
38
- "@thi.ng/errors": "^2.2.5",
39
- "@thi.ng/math": "^5.3.15",
40
- "@thi.ng/random": "^3.3.17",
41
- "@thi.ng/transducers": "^8.3.25",
42
- "@thi.ng/zipper": "^2.1.26"
37
+ "@thi.ng/api": "^8.6.1",
38
+ "@thi.ng/errors": "^2.2.6",
39
+ "@thi.ng/math": "^5.3.17",
40
+ "@thi.ng/random": "^3.3.19",
41
+ "@thi.ng/transducers": "^8.3.27",
42
+ "@thi.ng/zipper": "^2.1.28"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.33.5",
46
- "@thi.ng/testament": "^0.3.6",
45
+ "@microsoft/api-extractor": "^7.33.7",
46
+ "@thi.ng/testament": "^0.3.7",
47
47
  "rimraf": "^3.0.2",
48
48
  "tools": "^0.0.1",
49
- "typedoc": "^0.23.20",
50
- "typescript": "^4.8.4"
49
+ "typedoc": "^0.23.22",
50
+ "typescript": "^4.9.4"
51
51
  },
52
52
  "keywords": [
53
53
  "agent",
@@ -108,5 +108,5 @@
108
108
  "status": "alpha",
109
109
  "year": 2019
110
110
  },
111
- "gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n"
111
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
112
112
  }