1. 1 : /**
  2. 2 : * Base class for representing a term in a {@link FuzzyRule}.
  3. 3 : *
  4. 4 : * @author {@link https://github.com/Mugen87|Mugen87}
  5. 5 : */
  6. 6 : class FuzzyTerm {
  7. 7 :
  8. 8 : /**
  9. 9 : * Clears the degree of membership value.
  10. 10 : *
  11. 11 : * @return {FuzzyTerm} A reference to this term.
  12. 12 : */
  13. 13 : clearDegreeOfMembership() {}
  14. 14 :
  15. 15 : /**
  16. 16 : * Returns the degree of membership.
  17. 17 : *
  18. 18 : * @return {Number} Degree of membership.
  19. 19 : */
  20. 20 : getDegreeOfMembership() {}
  21. 21 :
  22. 22 : /**
  23. 23 : * Updates the degree of membership by the given value. This method is used when
  24. 24 : * the term is part of a fuzzy rule's consequent.
  25. 25 : *
  26. 26 : * @param {Number} value - The value used to update the degree of membership.
  27. 27 : * @return {FuzzyTerm} A reference to this term.
  28. 28 : */
  29. 29 : updateDegreeOfMembership( /* value */ ) {}
  30. 30 :
  31. 31 : /**
  32. 32 : * Transforms this instance into a JSON object.
  33. 33 : *
  34. 34 : * @return {Object} The JSON object.
  35. 35 : */
  36. 36 : toJSON() {
  37. 37 :
  38. 38 : return {
  39. 39 : type: this.constructor.name
  40. 40 : };
  41. 41 :
  42. 42 : }
  43. 43 :
  44. 44 : }
  45. 45 :
  46. 46 : export { FuzzyTerm };