@thi.ng/fuzzy 2.1.67 → 2.1.69
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 +1 -1
- package/README.md +1 -1
- package/package.json +4 -4
- package/rules.d.ts +2 -0
- package/shapes.d.ts +4 -0
- package/strategies/bisector.d.ts +2 -0
- package/strategies/centroid.d.ts +2 -0
- package/strategies/maxima.d.ts +6 -0
- package/var.d.ts +6 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
[](https://mastodon.thi.ng/@toxi)
|
|
19
19
|
|
|
20
20
|
> [!NOTE]
|
|
21
|
-
> This is one of
|
|
21
|
+
> This is one of 190 standalone projects, maintained as part
|
|
22
22
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
23
23
|
> and anti-framework.
|
|
24
24
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/fuzzy",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.69",
|
|
4
4
|
"description": "Fuzzy logic operators & configurable rule inferencing engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/math": "^5.10.
|
|
38
|
+
"@thi.ng/api": "^8.9.26",
|
|
39
|
+
"@thi.ng/math": "^5.10.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"thi.ng": {
|
|
106
106
|
"year": 2020
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
|
|
109
109
|
}
|
package/rules.d.ts
CHANGED
package/shapes.d.ts
CHANGED
|
@@ -125,6 +125,8 @@ export declare const invAlphaCut: (fn: FuzzyFn, alpha?: number) => FuzzyFn;
|
|
|
125
125
|
*
|
|
126
126
|
* @example
|
|
127
127
|
* ```ts
|
|
128
|
+
* import { compose, tnormMin, triangle } from "@thi.ng/fuzzy";
|
|
129
|
+
*
|
|
128
130
|
* const f = compose(tnormMin, 1, triangle(0,2,4), triangle(1,3,5));
|
|
129
131
|
* f(1); // 0
|
|
130
132
|
* f(2); // 0.5
|
|
@@ -134,6 +136,8 @@ export declare const invAlphaCut: (fn: FuzzyFn, alpha?: number) => FuzzyFn;
|
|
|
134
136
|
*
|
|
135
137
|
* @example
|
|
136
138
|
* ```ts
|
|
139
|
+
* import { compose, triangle } from "@thi.ng/fuzzy";
|
|
140
|
+
*
|
|
137
141
|
* // M-like shape w/ peaks at 3 & 5
|
|
138
142
|
* const M = compose(
|
|
139
143
|
* Math.max,
|
package/strategies/bisector.d.ts
CHANGED
package/strategies/centroid.d.ts
CHANGED
package/strategies/maxima.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
+
* import { meanOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
|
|
14
|
+
*
|
|
13
15
|
* meanOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
|
|
14
16
|
* // 3
|
|
15
17
|
*
|
|
@@ -39,6 +41,8 @@ export declare const meanOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>)
|
|
|
39
41
|
*
|
|
40
42
|
* @example
|
|
41
43
|
* ```ts
|
|
44
|
+
* import { firstOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
|
|
45
|
+
*
|
|
42
46
|
* firstOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
|
|
43
47
|
* // 1.02
|
|
44
48
|
*
|
|
@@ -68,6 +72,8 @@ export declare const firstOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>)
|
|
|
68
72
|
*
|
|
69
73
|
* @example
|
|
70
74
|
* ```ts
|
|
75
|
+
* import { lastOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
|
|
76
|
+
*
|
|
71
77
|
* lastOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
|
|
72
78
|
* // 4.98
|
|
73
79
|
*
|
package/var.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { LVar } from "./api.js";
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
+
* import { variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
|
|
10
|
+
*
|
|
9
11
|
* // temperature sets (in celsius)
|
|
10
12
|
* const temp = variable([-20, 40], {
|
|
11
13
|
* freezing: invSigmoid(0, 2),
|
|
@@ -27,6 +29,8 @@ export declare const variable: <K extends string>(domain: import("@thi.ng/api").
|
|
|
27
29
|
*
|
|
28
30
|
* @example
|
|
29
31
|
* ```ts
|
|
32
|
+
* import { classify, variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
|
|
33
|
+
*
|
|
30
34
|
* // temperature sets (in celsius)
|
|
31
35
|
* const temp = variable([-20, 40], {
|
|
32
36
|
* freezing: invSigmoid(0, 2),
|
|
@@ -50,6 +54,8 @@ export declare const classify: <K extends string>({ terms }: LVar<K>, x: number,
|
|
|
50
54
|
*
|
|
51
55
|
* @example
|
|
52
56
|
* ```ts
|
|
57
|
+
* import { evaluate, variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
|
|
58
|
+
*
|
|
53
59
|
* // temperature sets (in celsius)
|
|
54
60
|
* const temp = variable([-20, 40], {
|
|
55
61
|
* freezing: invSigmoid(0, 2),
|