updateDegreeOfMembership()
方法用于更新模糊集合的隶属度。
normalDistFuzzySet.updateDegreeOfMembership(x);
x
(Number) - 现有值。
无返回值。
NormalDistFuzzySet.prototype.updateDegreeOfMembership = function (x) {
var deltaX = x - this.mean;
var degreeOfMembership = Math.exp(-0.5 * Math.pow(deltaX / this.standardDeviation, 2));
this.degreeOfMembership = degreeOfMembership;
};
var normalDistFuzzySet = new NormalDistFuzzySet(50, 10);
normalDistFuzzySet.updateDegreeOfMembership(70);
console.log(normalDistFuzzySet.degreeOfMembership); // 0.36787944117144233