Skip to content
/ fis Public

A fuzzy inference system library written in Lua

License

Notifications You must be signed in to change notification settings

vccortez/fis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fis

fis is a simple fuzzy inference system library. It supports Lua >= 5.3.

Usage

First require the module to access its core objects:

local fis = require 'fis.init'

local fn = fis.Membership

local E = fis.Engine
local V = fis.Variables
local T = fis.Terms

local If = fis.Rules.build_rule
local P = fis.Propositions.create_proposition

To build a fuzzy inference system, start by creating an engine object:

local engine = E{name = 'inference engine'}

Add input and output variables:

local fuzzy_input = engine:add_input( V('input variable', 0, 10, 101) )
  :add_term(T('input term', fn.trimf, {0, 0, 5}))

local fuzzy_output = engine:add_output( V('output variable', 0, 10, 101) )
  :add_term(T('output term', fn.trapmf, {0, 0, 5, 10}))

And finally, reference your variables to create the rules:

local fuzzy_rules = engine:add_rules{
  If( P(fuzzy_input, 'input term') ).Then{{ fuzzy_output, 'output term' }},
  ...
}

License

This software is licensed under MIT.

About

A fuzzy inference system library written in Lua

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages