You are on page 1of 10

# Page 1 Stranica 1

## Artificial Intelligence Course : Module 9: Fuzzy logic Fuzzy LogicNeizrazita logika

1. Introduction 1. Uvod

## A way to represent variation or imprecision in logicNain predstavljanja varijacija

ili nepreciznosti u logici
A way to make use of natural language in logicNain koritenja prirodnog jezika u
logici
Priblian zakljuak Approximate reasoning

Humans say things like "If it is sunny and warm today, I will drive fast" Ljudi kau stvari
poput "Ako je danas sunano i toplo, vozit u brzo"

## Linguistic variables: jezine varijable:

Temp: {freezing, cool, warm, hot} Temp: {zamrzavanje, hladno, toplo, vrue}
Oblak pokrivenosti: {oblano, djelomino oblano, sunano}
Brzina: {slow, fast}

Crisp variables represent precise quantities: vrste varijable predstavljaju tone veliine:

x = 3.1415296 x = 3,1415296
A {0,1}

A B CA B C

zlo (Richard)

## 3. Fuzzy Sets 3. Fuzzy setovi

What if Richard is only somewhat greedy? to ako Richard samo malo pohlepan?
Fuzzy Sets can represent the degree to which a quality is possessed. Fuzzy setovi mogu
predstavljati stupanj do kojeg je kvaliteta posjedovana.

Fuzzy Sets (Simple Fuzzy Variables) have values in the range of [0,1] Fuzzy setovi
(Simple Fuzzy Variables) imaju vrijednosti u rasponu od [0,1]

## 4. Fuzzy Linguistic Variables 4. Fuzzy jezine varijable

Fuzzy Linguistic Variables are used to represent qualities spanning a particular spectrum
Fuzzy lingvistike varijable koriste se za predstavljanje kvaliteta koje obuhvaaju odreeni
spektar

Temp: {Freezing, Cool, Warm, Hot} Temperatura: {smrzava, Cool, toplo, vrue}

## 5. Membership Functions 5. Funkcije lanstva

Temp: {Freezing, Cool, Warm, Hot} Temp: {Zamrzavanje, hladno, toplo, vrue}

## Degree of Truth or "Membership" Stupanj istine ili "lanstvo"

11

Page 2 Stranica 2

## Artificial Intelligence Course : Module 9: Fuzzy logic Umjetna inteligencija predmeta:

Modul 9: Neizrazita logika

## It is 30% Cool and 70% Freezing, To je 30% hladno i 70% za zamrzavanje,

6. Fuzzy Logic Operators 6. Fuzzy operatori logike

How do we use fuzzy membership functions in predicate logic? Kako koristimo nejasne
funkcije lanstva u predikatnoj logici?

## Operate on degrees of membership in fuzzy sets Djelujte na stupnjevima lanstva u

neizrazitim setovima

## AB = C "Quality C is the disjunction of Quality A and B" AB = C "Kvaliteta C je

razdvajanje kvalitete A i B"

kvalitete A i B"

0.7 0,7

0.3 0,3

## (AB = C) (C = 0.375) (A B = C) (C = 0,375)

22

Page 3 Stranica 3

## Artificial Intelligence Course : Module 9: Fuzzy logic Umjetna inteligencija predmeta:

Modul 9: Neizrazita logika

## Lecture Date: 14-03-2016 Datum predavanja: 14-03-2016

Time: 08:30 Am Vrijeme: 08:30 am

## Example 2: Fuzzy Conjunction: Calculate AB given that A is .4 and B is 20? Primjer 2:

fuzzy Square: Izraunati AB obzirom da je A .4 i B je 20?

B = 0,9,

## 7. Fuzzy Control 7. Fuzzy Control

Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic Fuzzy
Control kombinira upotrebu neizrazitih jezinih varijabli s neizrazitom logikom

## Example: Speed Control Primjer: Kontrola brzine

How fast am I going to drive today? Koliko brzo idem voziti danas?

## 7.1 Inputs: Temperature 7.1 Ulazi: Temperatura

Temp: {Freezing, Cool, Warm, Hot} Temp: {Zamrzavanje, hladno, toplo, vrue}

## Cover: {Sunny, Partly, Overcast Pokriva: {Sunny, Djelomino, Oblano

0.9 0,9

0.7 0,7

33

Page 4 Stranica 4

## Artificial Intelligence Course : Module 9: Fuzzy logic Umjetna inteligencija predmeta:

Modul 9: Neizrazita logika

## Time: 08:30 Am Vrijeme: 08:30 am

7.2 Output: Speed 7.2 Izlaz: Brzina

Temp: {Freezing, Cool, Warm, Hot} Temp: {Zamrzavanje, hladno, toplo, vrue}

8. Rules 8. Pravila

If it's Sunny and Warm, drive Fast Ako je sunano i toplo, vozite brzo

Sunny (Cover) Warm (Temp) Fast (Speed) Sunano (pokriva) Vlada (Temp) Brzo
(Brzina)

If it's Cloudy and Cool, drive Slow Ako je Cloudy i Cool, vozite Sporo

Cloudy (Cover) Cool (Temp) Slow (Speed) Oblano (pokriva) Cool (Temp) Sporo
(Brzina)

Driving Speed is the combination of output of these rules... Brzina vonje je kombinacija
izlaza ovih pravila ...

65 F 65 F

lanstva

## 65 F Cool = 0.4, Warm= 0.7 65 F Cool = 0,4, Toplo = 0,7

25% Cover Sunny = 0.8, Cloudy = 0.2 Poklopac od 25% Sunny = 0,8, Oblano = 0,2

44

Page 5 Stranica 5

## Artificial Intelligence Course : Module 9: Fuzzy logic Umjetna inteligencija predmeta:

Modul 9: Neizrazita logika

## Time: 08:30 Am Vrijeme: 08:30 am

... Calculating... ... Izraun ...

If it's Sunny and Warm, drive Fast Ako je sunano i toplo, vozite brzo

Sunny (Cover) Warm (Temp) Fast (Speed) Sunano (pokriva) Warm (Temp) Brzo
(Brzina)

0.8 0.7 = 0.7 Fast = 0.7 0.8 0,7 0,7 0,7 Brzo

If it's Cloudy and Cool, drive Slow Ako je Cloudy i Cool, vozite Sporo

Cloudy (Cover) Cool (Temp) Slow (Speed) Oblano (pokriva) Cool (Temp) Slow
(Brzina)

0.2 0.4 = 0.2 Slow = 0.2 0.2 0.4 = 0.2 Sporo = 0.2

## Defuzzification: Constructing the Output Defuzzification: Izrada izlaza

Speed is 20% Slow and 70% Fast Brzina je 20% spora i 70% bra

Find centroids: Location where membership is 100%? Pronaite centaride: mjesto gdje
je lanstvo 100%?

Solution: Rijeenje:

Speed = weighted mean = (2*25+7*75)/ (9) = 63.8 mph Brzina = ponderirana srednja
vrijednost = (2 * 25 + 7 * 75) / (9) = 63.8 mph

## 9. Notes: Follow-up Points 9. Napomene: Follow-up Points

Fuzzy Logic Control allows for the smooth interpolation between variable centroids with
relatively few Fuzzy Logic Control omoguuje glatku interpolaciju izmeu varijabilnih
sredita s relativno malo

rules pravila

This does not work with crisp (traditional Boolean) logic Ovo ne radi s jasnom

Provides a natural way to model some types of human expertise in a computer program
Prua prirodan nain modeliranja nekih vrsta ljudske strunosti u raunalnom programu

10. Notes: Drawbacks to Fuzzy logic 10. Biljeke: Nedostaci u neizrazitoj logici

## Requires tuning of membership functions Zahtijeva usklaivanje lanstva

Fuzzy Logic control may not scale well to large or complex problems Fuzzy Logic
kontrola ne smije se dobro prilagoditi velikim ili sloenim problemima
Deals with imprecision, and vagueness, but not uncertainty Bavi se nepreciznosti i
neodreenosti, ali ne i nesigurnosti

55