es6-fuzz

fuzzy logic with and for es6

Usage no npm install needed!

<script type="module">
  import es6Fuzz from 'https://cdn.skypack.dev/es6-fuzz';
</script>

README

es6-fuzz

Fuzzy Logic in Javascript

npm license GitHub tag Travis GitHub issues

Supported fuzzyfiers

Install and Usage

es6-fuzz is available as a NPM package.

npm install es6-fuzz

Example

var logic = new Logic();
var res = logic
  .init('noAttack', new Triangle(0, 20, 40))
  .or('normalAttack', new Trapezoid(20, 30, 90, 100))
  .or('enragedAttack', new Grade(90, 100))
    .defuzzify(40);
  • enraged attack

Example 2

var Trapezoid = require('./lib/curve/trapezoid');

var logic = new Logic();
var res = logic
  .init('cold', new Trapezoid(0, 12, 18, 20))   
  .or('hot', new Trapezoid(12, 14, 16, 100)) 
  .defuzzify(20);

  • hot

development

Tests use mocha and a plugin for traceur

npm test
  • docs: npm run docs, npm run docs:site

Stuff

Supported Node.js Versions

Versions: 6 and 7

Related