Example 2 doesn't work
nateeo opened this issue · 1 comments
nateeo commented
The second example is missing another closing bracket on the second line (new Triangle ...
)
Also the console.log(res)
always evaluates to hot, even if I try defuzzify small values?
var res = logic
.init('verycold', new Triangle(new Trapezoid(0, 0, 8, 12)) // until 10 degrees very cold
.and('cold', new Trapezoid(8, 12, 18, 20)) // until 12-18 around warm
.and('hot', new Trapezoid(12, 20, 30, 100)) // all up from 30 surely hot
.defuzzify(99);
console.log(res);
sebs commented
using or and updating to 3.0.2 should fix the issue.
Thanks for bringing it up