UNPKG

@thi.ng/fuzzy

Version:

Fuzzy logic operators & configurable rule inferencing engine

18 lines (17 loc) 450 B
import { snormMax, tnormMin, tnormProduct } from "./tnorms.js"; const rule = (op, $if, then, weight = 1) => ({ if: $if, then, // eslint-disable-line no-thenable op, weight }); const and = ($if, then, weight) => rule(tnormMin, $if, then, weight); const strongAnd = ($if, then, weight) => rule(tnormProduct, $if, then, weight); const or = ($if, then, weight) => rule(snormMax, $if, then, weight); export { and, or, rule, strongAnd };