@thi.ng/fuzzy 2.0.0 → 2.0.1

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
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/fuzzy@2.0.0...@thi.ng/fuzzy@2.0.1) (2021-10-13)
7
+
8
+ **Note:** Version bump only for package @thi.ng/fuzzy
9
+
10
+
11
+
12
+
13
+
6
14
  # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/fuzzy@1.0.4...@thi.ng/fuzzy@2.0.0) (2021-10-12)
7
15
 
8
16
 
package/README.md CHANGED
@@ -80,10 +80,11 @@ ES module import:
80
80
 
81
81
  [Skypack documentation](https://docs.skypack.dev/)
82
82
 
83
- For NodeJS (v14.6+):
83
+ For Node.js REPL:
84
84
 
85
85
  ```text
86
- node --experimental-specifier-resolution=node --experimental-repl-await
86
+ # with flag only for < v16
87
+ node --experimental-repl-await
87
88
 
88
89
  > const fuzzy = await import("@thi.ng/fuzzy");
89
90
  ```
package/defuzz.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LVarSet, Rule } from "./api";
1
+ import type { LVarSet, Rule } from "./api.js";
2
2
  /**
3
3
  * Takes an object of input {@link variable}s, an object of output variable,
4
4
  * rule array and an object of input values. Evaluates relevant terms of input
@@ -25,5 +25,5 @@ import type { LVarSet, Rule } from "./api";
25
25
  * @param imply
26
26
  * @param combine
27
27
  */
28
- export declare const defuzz: <I extends LVarSet<string>, O extends LVarSet<string>>(ins: I, outs: O, rules: Rule<I, O>[], vals: Partial<Record<keyof I, number>>, strategy?: import("./api").DefuzzStrategy, imply?: import("@thi.ng/api").FnN2, combine?: import("@thi.ng/api").FnN2) => Partial<Record<keyof O, number>>;
28
+ export declare const defuzz: <I extends LVarSet<string>, O extends LVarSet<string>>(ins: I, outs: O, rules: Rule<I, O>[], vals: Partial<Record<keyof I, number>>, strategy?: import("./api.js").DefuzzStrategy, imply?: import("@thi.ng/api").FnN2, combine?: import("@thi.ng/api").FnN2) => Partial<Record<keyof O, number>>;
29
29
  //# sourceMappingURL=defuzz.d.ts.map
package/defuzz.js CHANGED
@@ -1,6 +1,6 @@
1
- import { constant, intersect, union, weighted } from "./shapes";
2
- import { centroidStrategy } from "./strategies/centroid";
3
- import { snormMax, tnormMin } from "./tnorms";
1
+ import { constant, intersect, union, weighted } from "./shapes.js";
2
+ import { centroidStrategy } from "./strategies/centroid.js";
3
+ import { snormMax, tnormMin } from "./tnorms.js";
4
4
  /**
5
5
  * Takes an object of input {@link variable}s, an object of output variable,
6
6
  * rule array and an object of input values. Evaluates relevant terms of input
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from "./api";
2
- export * from "./defuzz";
3
- export * from "./rules";
4
- export * from "./shapes";
5
- export * from "./tnorms";
6
- export * from "./var";
7
- export * from "./strategies/bisector";
8
- export * from "./strategies/centroid";
9
- export * from "./strategies/maxima";
1
+ export * from "./api.js";
2
+ export * from "./defuzz.js";
3
+ export * from "./rules.js";
4
+ export * from "./shapes.js";
5
+ export * from "./tnorms.js";
6
+ export * from "./var.js";
7
+ export * from "./strategies/bisector.js";
8
+ export * from "./strategies/centroid.js";
9
+ export * from "./strategies/maxima.js";
10
10
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- export * from "./api";
2
- export * from "./defuzz";
3
- export * from "./rules";
4
- export * from "./shapes";
5
- export * from "./tnorms";
6
- export * from "./var";
7
- export * from "./strategies/bisector";
8
- export * from "./strategies/centroid";
9
- export * from "./strategies/maxima";
1
+ export * from "./api.js";
2
+ export * from "./defuzz.js";
3
+ export * from "./rules.js";
4
+ export * from "./shapes.js";
5
+ export * from "./tnorms.js";
6
+ export * from "./var.js";
7
+ export * from "./strategies/bisector.js";
8
+ export * from "./strategies/centroid.js";
9
+ export * from "./strategies/maxima.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/fuzzy",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Fuzzy logic operators & configurable rule inferencing engine",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,11 +34,11 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.0.0",
38
- "@thi.ng/math": "^5.0.0"
37
+ "@thi.ng/api": "^8.0.1",
38
+ "@thi.ng/math": "^5.0.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@thi.ng/testament": "^0.1.0"
41
+ "@thi.ng/testament": "^0.1.1"
42
42
  },
43
43
  "keywords": [
44
44
  "agent",
@@ -54,6 +54,9 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
+ "engines": {
58
+ "node": ">=12.7"
59
+ },
57
60
  "files": [
58
61
  "*.js",
59
62
  "*.d.ts",
@@ -97,5 +100,5 @@
97
100
  "thi.ng": {
98
101
  "year": 2020
99
102
  },
100
- "gitHead": "9ac1344b38b565eb894306fbf72233b6c0b2d115"
103
+ "gitHead": "2e6b3d7c0f4c5686c1e9bdb4902ed7d3f90bcc19"
101
104
  }
package/rules.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FnN2 } from "@thi.ng/api";
2
- import type { LVarKeySet, LVarSet, Rule } from "./api";
2
+ import type { LVarKeySet, LVarSet, Rule } from "./api.js";
3
3
  /**
4
4
  * Defines and returns a new rule object. Takes a T-norm (or S-norm) `op`, an
5
5
  * object of input conditions, an object of results and optional rule `weight`.
package/rules.js CHANGED
@@ -1,4 +1,4 @@
1
- import { snormMax, tnormMin, tnormProduct } from "./tnorms";
1
+ import { snormMax, tnormMin, tnormProduct } from "./tnorms.js";
2
2
  /**
3
3
  * Defines and returns a new rule object. Takes a T-norm (or S-norm) `op`, an
4
4
  * object of input conditions, an object of results and optional rule `weight`.
package/shapes.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FnN2, FnU, FnU2, FnU3, FnU4 } from "@thi.ng/api";
2
- import type { FuzzyFn } from "./api";
2
+ import type { FuzzyFn } from "./api.js";
3
3
  /**
4
4
  * HOF {@link FuzzyFn} always yielding given `x` (should be in [0,1]
5
5
  * interval).
@@ -1,4 +1,4 @@
1
- import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
1
+ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
2
2
  /**
3
3
  * Higher-order function: Bisector-of-Area defuzzification strategy. Returns
4
4
  * strategy which computes the integral of a given fuzzy set in the defined
@@ -1,5 +1,5 @@
1
1
  import { fit } from "@thi.ng/math/fit";
2
- import { defaultOpts } from "./opts";
2
+ import { defaultOpts } from "./opts.js";
3
3
  /**
4
4
  * Higher-order function: Bisector-of-Area defuzzification strategy. Returns
5
5
  * strategy which computes the integral of a given fuzzy set in the defined
@@ -1,4 +1,4 @@
1
- import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
1
+ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
2
2
  /**
3
3
  * Higher-order function: Centre-of-gravity defuzzification strategy, yielding
4
4
  * the approx. center of gravity position of a given fuzzy set. The domain is
@@ -1,4 +1,4 @@
1
- import { defaultOpts } from "./opts";
1
+ import { defaultOpts } from "./opts.js";
2
2
  /**
3
3
  * Higher-order function: Centre-of-gravity defuzzification strategy, yielding
4
4
  * the approx. center of gravity position of a given fuzzy set. The domain is
@@ -1,4 +1,4 @@
1
- import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
1
+ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
2
2
  /**
3
3
  * Higher-order function. Returns Mean-of-Maxima defuzzification strategy,
4
4
  * yielding the approx. mean of the maximum region of a given fuzzy set.
@@ -1,5 +1,5 @@
1
1
  import { eqDelta } from "@thi.ng/math/eqdelta";
2
- import { defaultOpts } from "./opts";
2
+ import { defaultOpts } from "./opts.js";
3
3
  /**
4
4
  * Higher-order function. Returns Mean-of-Maxima defuzzification strategy,
5
5
  * yielding the approx. mean of the maximum region of a given fuzzy set.
@@ -1,3 +1,3 @@
1
- import type { DefuzzStrategyOpts } from "../api";
1
+ import type { DefuzzStrategyOpts } from "../api.js";
2
2
  export declare const defaultOpts: (opts?: Partial<DefuzzStrategyOpts> | undefined) => DefuzzStrategyOpts;
3
3
  //# sourceMappingURL=opts.d.ts.map
package/var.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LVar } from "./api";
1
+ import type { LVar } from "./api.js";
2
2
  /**
3
3
  * Takes a `domain` interval and on object of named fuzzy sets and returns a new
4
4
  * Linguistic variable, which can then be used as input or output var for
@@ -18,7 +18,7 @@ import type { LVar } from "./api";
18
18
  * @param domain
19
19
  * @param terms
20
20
  */
21
- export declare const variable: <K extends string>(domain: import("@thi.ng/api").Range, terms: import("./api").LVarTerms<K>) => LVar<K>;
21
+ export declare const variable: <K extends string>(domain: import("@thi.ng/api").Range, terms: import("./api.js").LVarTerms<K>) => LVar<K>;
22
22
  /**
23
23
  * Takes an LVar and a domain value `x`. Returns the ID of the var's fuzzy set
24
24
  * term which yields the max truth value for given `x`. If `threshold` is