A Fuzzy Associative Memory (FAM for short) is a Fuzzy Logic tool for decision making. Fuzzy logic FAMs have a wide range of practical applications:
A Fuzzy Associative Memory uses Fuzzy Sets to establish a set of rules that are linguistic in nature; examples might include:
The linguistic rules, and the fuzzy sets they contain, are defined by a human "expert" (presumably, you). That is to say, the rules codify intelligence and map this knowledge from the human domain to the digital.
After the rules are defined, a FAM is consulted to help your AI make a descision:
As you can see, the fuzzy rules are deliberately vague and use qualifiers like "a little" and "a lot". Furthermore, the lines between fuzzy sets are intentionally blurry. This is the nature of fuzzy sets; they capture such human fuzziness in a way that extracts highly natural behavior from the fuzzy rules. When defining these rules, it helps to imagine interviewing a bona fide expert in the domain and writing down the skills necessary to be successful in the domain.
Fuzzy Linguistic Variables can be hard to visualize, especially when they get complex and include triangles and trapezoids in combination. To answer that, this software can now (optionally) shell out to your installed Gnuplot and create PNG or SVG renderings of your FLVs. Here's an example:
This is working, functional software, suitable for use in your own game or application. It currently supports:
if A then Z
)if A or B, then Z
/ if A and B, then Z
)To do (in descending importance, roughly):
Watch the changelog for news.
I recommend you clone the Git repository and browse the examples and source code to fully understand how FAMs work.
But if / when you want to use this in your own project, the easiest way to do so is via the Gem:
gem install fuzzy_associative_memory
Then in your code:
require 'fuzzy_associative_memory'
The gem is fully namespaced to prevent collisions. See the examples for usage details.
The bin
directory contains the following examples:
hvac_system_example
illustrates how a FAM could govern an HVAC fan unit to maintain a constant, comfortable temperatureweapon_choice_example
illustrates how a FAM could let a game bot intelligently decide which weapon to usePlots of the examples' fuzzy linguistic variables have been pre-rendered and are in the bin directory. These will help you visualize the FLVs.