Fuzz-C™
Fuzz-C™ is a stand-alone preprocessor
that seamlessly integrates fuzzy logic
into the C language. Now you can add
fuzzy logic to your applications without
expensive, specialized hardware or
software. Fuzz-C accepts fuzzy logic
rules, membership functions and
consequence functions, and produces
C source code that can be compiled by
most C compilers, including the Byte
Craft Limited Code Development
System.
The preprocessor generates C code
that is both compact and significantly
faster than most current fuzzy logic
commercial implementations—all with
your favorite C compiler.
Fuzz-C provides a practical, unified
solution for applications that require
fuzzy logic control systems. Use your
existing C libraries for program
management, keyboard handlers and
display functions without change; you
can implement system control functions
using fuzzy rules.
Fuzz-C is a flexible system that allows
all data types supported by your C
compiler. Standard defuzzification
methods, such as center of gravity, max
left, max right, and max average, are
provided in source form. Fuzz-C lets
you easily add new defuzzification
methods.
Fuzzy Logic Preprocessor for C
ox40;
gs&0x20)
table();
02A4 A
02A6 B
02A9 C
Fuzz-C™ includes one year technical support via phone
or email. Fuzz-C requires modest system resources:
DOS or Windows and less than 1 megabyte of memory.
Fuzz-C works with make and other industry-standard
build systems. Complete documentation is included.
Terms: prepaid American Express, VISA or cheque. Overseas orders prepaid in U.S. funds
drawn on a Canadian or U.S. bank only. Please obtain appropriate import documentation.
Canadian customers are subject to applicable taxes. Specifications and price information subject
to change without notice. Fuzz-C is a registered trademark of Byte Craft Limited. Other marks are
trademarks or registered trademarks of their respective holders.
/* Fuzzy Logic Climate Controller
This single page of code creates a fully
Functional controller for a simple air
conditioning system */
#define thermostat PORTA
#define airCon PORTB.7
/* degrees celsius */
LINGUISTIC room TYPE int MIN 0 MAX 50
{
MEMBER cold { 0, 0, 15, 20 }
MEMBER normal { 20, 23, 25 }
MEMBER hot { 25, 30, 50, 50 }
}
/* A.C on or off */
CONSEQUENCE ac TYPE int DEFUZZ CG
{
MEMBER ON { 1 }
MEMBER OFF { 0 }
}
/* Rules to follow */
FUZZY climateControl
{
IF room IS cold THEN
ac IS OFF
IF room IS normal THEN
ac IS OFF
IF room IS hot THEN
ac IS ON
}
int main(void)
{
while(1)
{
/* find the temperature */
room = thermostat;
/* apply the rules */
climateControl();
/* switch the A.C. */
airCon = ac;
wait(10);
}
}
Binary
Trapezoidal
Triangle
"hot"
Membership
Functions
"normal"
room
Fuzzy 1
Fuzzy 0
"cold"
Center of Gravity
Calculation
Center of Gravity
Calculation