npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-fuzzy

v1.0.1

Published

Event-driven Takagi-Sugeno Fuzzy Inference System implementation for Node-RED

Downloads

15

Readme

node-red-contrib-fuzzy

Event-driven Takagi-Sugeno Fuzzy Inference System implementation for Node-RED

This repository contains an implementation of event-driven control network based Takagi-Sugeno Fuzzy Inference System in Node-RED. The Node-RED implementation based on the idea that the Takagi-Sugeno Fuzzy Inference System can be represented as a network-like model and implemented as a event driven control network. For furhter information please find the publication on ResearchGate.

Quick Start

  1. Install node-red-contrib-fuzzy package via Palette Manager
  2. Import the test flow test/flow.js template and modify Node-RED TS-FIS
  3. Create a test plot surface by opening http://127.0.0.1:1880/plot in your browser. If Node-RED is not running on your computer change the URL. Surface Plot

TS-FIS Nodes

Input node

The input nodes prepares a message with a data structure from the input crisp values for the membership functions. The data structure of each input nodes contains a unique identifier and the crisp value. This identifier used to identify the inputs for consequent nodes to calculate the outputs. The presence of the input crisp value in the data structure is required by the first order TS-FIS output value calculation in consequent nodes. In the case of only zero order TS-FIS outputs the input crisp values can be eliminated and simplify the input node. The Input node receive values as msg.payload and the ID should be set in the node configuration.

Membership function nodes

Membership function nodes carry out a fuzzy partition of the input space. The fuzzy membership function node from the incoming messages calculates the fuzzy set value (µxi) from the crisp value (xi). In event-driven fuzzy system entities that implement membership functions generate fuzzy set values (µxi) on the output of the messages when receive message into the input queue. The nodes can be easily configured by setting the breaking point paramters according to the membership function. Implemented memberhip functions:

  • Grade
  • Reverse Grade
  • Triangle
  • Trapezoid

Fuzzy operators-Antecedent

In event-driven FIS network the implication is formed from the antecedence as the fuzzy operator and the applied consequences as output functions. The node needs an internal memory to store the last value of inputs fuzzy set values in records. The internal memory updates the records when receive new fuzzy set value change. The fuzzy operator node sends message after updates the ouput firing rule weight according to the applied triangular norm. The output messages contains the firing weight and the crisp input value. The outgoing message is containes the weight of the firing rule (wi) and the list of the updated input crisp values (xi).

  • and: T-norm min(µx1x2x3,...)
  • or: S-norm max(µx1x2x3,...)
  • not:Complement (1-µ)

Implication - Consequent

The implication for the Takagi-Sugeno FIS has zero and first order consequent output functions. The consequent node calculates the output value by input crisp values and the predefined coefficients. The output message of the consequent node contains the crisp function value (zi), the firing weight (wi) and the node identifier for aggregating the output. Implication function can be defined as adding variables with a coefficient and a constant value.

Aggregation

The aggregation node is calculating the final output of the event-driven FIS network from the weighted average of the aggregation of all the singletons. The aggregation node sends an output message when receive an input message. The output msg.payload contains the output value and the input values too e.g.:

{
  "output": 1.25,
  "input": [
    {
      "id": "x1",
      "value": 1
    },
    {
      "id": "x2",
      "value": 1
    }
  ]
}