UNPKG

@thi.ng/fuzzy

Version:

Fuzzy logic operators & configurable rule inferencing engine

100 lines 4.79 kB
import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js"; /** * Higher-order function. Returns Mean-of-Maxima defuzzification strategy, * yielding the approx. mean of the maximum region of a given fuzzy set. * * @remarks * Use `samples` option to adjust precision. * * Also see {@link DefuzzStrategyOpts} * * @example * ```ts tangle:../../export/mean-of-maxima-strategy.ts * import { meanOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy"; * * console.log( * meanOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6]) * ); * // 3 * * // ......▁█████████████|█████████████▁..... * // ......██████████████|██████████████..... * // .....███████████████|███████████████.... * // ....▇███████████████|███████████████▇... * // ...▅████████████████|████████████████▅.. * // ..▃█████████████████|█████████████████▃. * // .▁██████████████████|██████████████████▁ * // .███████████████████|███████████████████ * // ^ 3.00 * ``` * * @param opts - */ export declare const meanOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>) => DefuzzStrategy; /** * Higher-order function. Returns First-of-Maxima defuzzification strategy, * yielding the approx. start position of the maximum region of a given fuzzy * set. * * @remarks * Use `samples` option to adjust precision. * * Also see {@link DefuzzStrategyOpts} * * @example * ```ts tangle:../../export/first-of-maxima-strategy.ts * import { firstOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy"; * * console.log( * firstOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6]) * ); * // 1.02 * * // ......▁|██████████████████████████▁..... * // ......█|███████████████████████████..... * // .....██|████████████████████████████.... * // ....▇██|████████████████████████████▇... * // ...▅███|█████████████████████████████▅.. * // ..▃████|██████████████████████████████▃. * // .▁█████|███████████████████████████████▁ * // .██████|████████████████████████████████ * // ^ 1.02 * ``` * * @param opts - */ export declare const firstOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>) => DefuzzStrategy; /** * Higher-order function. Returns Last-of-Maxima defuzzification strategy, * yielding the approx. final position of the maximum region of a given fuzzy * set. * * @remarks * Use `samples` option to adjust precision. * * Also see {@link DefuzzStrategyOpts} * * @example * ```ts tangle:../../export/last-of-maxima-strategy.ts * import { lastOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy"; * * console.log( * lastOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6]) * ); * // 4.98 * * // ......▁██████████████████████████|▁..... * // ......███████████████████████████|█..... * // .....████████████████████████████|██.... * // ....▇████████████████████████████|██▇... * // ...▅█████████████████████████████|███▅.. * // ..▃██████████████████████████████|████▃. * // .▁███████████████████████████████|█████▁ * // .████████████████████████████████|██████ * // ^ 4.98 * ``` * * @param opts - */ export declare const lastOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>) => DefuzzStrategy; //# sourceMappingURL=maxima.d.ts.map