Fuzzy Logic By Andrew Pro. References Alexander, Thor, “An Optimized Fuzzy Logic Architecture For Decision Making”, AI Game Wisdom. Bonissone, P. Piero.

Slides:



Advertisements
Similar presentations
The general Game AI concept
Advertisements

Sahar Mosleh PageCalifornia State University San Marcos 1 Introductory Concepts This section of the course introduces the concept of digital circuits and.
Brief introduction on Logistic Regression
P is a subset of NP Let prob be a problem in P There is a deterministic algorithm alg that solves prob in polynomial time O(n k ), for some constant k.
 Negnevitsky, Pearson Education, Lecture 5 Fuzzy expert systems: Fuzzy inference n Mamdani fuzzy inference n Sugeno fuzzy inference n Case study.
Fuzzy Expert System  An expert might say, “ Though the power transformer is slightly overloaded, I can keep this load for a while”.  Another expert.
AI – CS364 Fuzzy Logic Fuzzy Logic 3 03 rd October 2006 Dr Bogdan L. Vrusias
Fuzzy Inference and Defuzzification
Chapter Eleven Artificial Intelligence II: Operational Perspective.
Fuzzy Logic Steve Foster.
Chapter 14.7 Russell & Norvig. Fuzzy Sets  Rules of thumb frequently stated in “fuzzy” linguistic terms. John is tall. If someone is tall and well-built.
AI TECHNIQUES Fuzzy Logic (Fuzzy System). Fuzzy Logic : An Idea.
Fuzzy Expert System. Basic Notions 1.Fuzzy Sets 2.Fuzzy representation in computer 3.Linguistic variables and hedges 4.Operations of fuzzy sets 5.Fuzzy.
Fuzzy Expert Systems. Lecture Outline What is fuzzy thinking? What is fuzzy thinking? Fuzzy sets Fuzzy sets Linguistic variables and hedges Linguistic.
Fuzzy Sets and Fuzzy Logic Chapter 12 M. Tim Jones See also
Fuzzy Logic.
Final Exam: May 10 Thursday. If event E occurs, then the probability that event H will occur is p ( H | E ) IF E ( evidence ) is true THEN H ( hypothesis.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
FUZZY Logic for Game Programmers
Artificial Intelligence in Game Design Introduction to Learning.
Ai in game programming it university of copenhagen Statistical Learning Methods Marco Loog.
Artificial Intelligence in Game Design Hierarchical Finite State Machines.
GATE Reactive Behavior Modeling Fuzzy Logic (GATE-561) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies Bilkent University,
 How many here made a qualitative decision this morning?  Who decided that this program would be more beneficial to them than other programs?  Who.
Fuzzy Expert System.
Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A.
1 Chapter 18 Fuzzy Reasoning. 2 Chapter 18 Contents (1) l Bivalent and Multivalent Logics l Linguistic Variables l Fuzzy Sets l Membership Functions l.
Learning decision trees derived from Hwee Tou Ng, slides for Russell & Norvig, AI a Modern Approachslides Tom Carter, “An introduction to information theory.
WELCOME TO THE WORLD OF FUZZY SYSTEMS. DEFINITION Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept.
Memory-Based Learning Instance-Based Learning K-Nearest Neighbor.
CHAPTER 5 SUPPLY.
Induction of Decision Trees (IDT) CSE 335/435 Resources: – –
Fuzzy Logic BY: ASHLEY REYNOLDS. Where Fuzzy Logic Falls in the Field of Mathematics  Mathematics  Mathematical Logic and Foundations  Fuzzy Logic.
Information Theory and Games (Ch. 16). Information Theory Information theory studies information flow Under this context information has no intrinsic.
FUZZY LOGIC Babu Appat. OVERVIEW What is Fuzzy Logic? Where did it begin? Fuzzy Logic vs. Neural Networks Fuzzy Logic in Control Systems Fuzzy Logic in.
“Real Estate Principles for the New Economy”: Norman G. Miller and David M. Geltner Chapter 13 The Market Approach to Value.
INTRODUCTION TO MACHINE LEARNING. $1,000,000 Machine Learning  Learn models from data  Three main types of learning :  Supervised learning  Unsupervised.
Artificial Intelligence in Game Design Lecture 6: Fuzzy Logic and Fuzzy State Machines.
 Definition Definition  Bit of History Bit of History  Why Fuzzy Logic? Why Fuzzy Logic?  Applications Applications  Fuzzy Logic Operators Fuzzy.
Learning from Observations Chapter 18 Through
CHAPTER 10: CORE MECHANICS Definitions and Mechanisms.
I Robot.
Logical Systems and Knowledge Representation Fuzzy Logical Systems 1.
Fuzzy Systems Michael J. Watts
Lógica difusa  Bayesian updating and certainty theory are techniques for handling the uncertainty that arises, or is assumed to arise, from statistical.
Uncertainty Management in Rule-based Expert Systems
Fuzzy Sets and Control. Fuzzy Logic The definition of Fuzzy logic is a form of multi-valued logic derived frommulti-valued logic fuzzy setfuzzy set theory.
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 12 FUZZY.
Fuzzy Expert System n Introduction n Fuzzy sets n Linguistic variables and hedges n Operations of fuzzy sets n Fuzzy rules n Summary.
Artificial Intelligence in Game Design Influence Maps and Decision Making.
Chapter 9: Introduction to the t statistic. The t Statistic The t statistic allows researchers to use sample data to test hypotheses about an unknown.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Fuzzy Logic 1. Introduction Form of multivalued logic Deals reasoning that is approximate rather than precise The fuzzy logic variables may have a membership.
Dinner for Two. Fuzzify Inputs Apply Fuzzy Operator.
CHAPTER 5 Handling Uncertainty BIC 3337 EXPERT SYSTEM.
Introduction to Fuzzy Logic and Fuzzy Systems
Fuzzy Systems Michael J. Watts
Fuzzy Inference Systems
Fuzzy expert systems Fuzzy inference Mamdani fuzzy inference
Fuzzy Logic and Fuzzy Sets
Artificial Intelligence and Adaptive Systems
Chap 3: Fuzzy Rules and Fuzzy Reasoning
Fuzzy logic Introduction 3 Fuzzy Inference Aleksandar Rakić
Dr. Unnikrishnan P.C. Professor, EEE
FUZZIFICATION AND DEFUZZIFICATION
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
Fundamentals of Data Representation
Fuzzy Logic Colter McClure.
Dr. Unnikrishnan P.C. Professor, EEE
Memory-Based Learning Instance-Based Learning K-Nearest Neighbor
Presentation transcript:

Fuzzy Logic By Andrew Pro

References Alexander, Thor, “An Optimized Fuzzy Logic Architecture For Decision Making”, AI Game Wisdom. Bonissone, P. Piero and Cheetham, William, “Fuzzy Case Based Reasoning For Residential Property Valuation” ( course/99/L10/fuzzycbr4realestate.pdf) course/99/L10/fuzzycbr4realestate.pdf Hansen, Bjarne K., and Riordan, Denis, “Weather Prediction Using Case-Based Reasoning and Fuzzy Set Theory” ( Hellman, M., “Fuzzy Logic Introduction” ( 1&type=pdf) 1&type=pdf Shwab, Brian, AI Game Engine Programming. ( orce=1) orce=1 Zarozinski, Michael, “Imploding Combinatorial Explosion In A Fuzzy System”, Game Programming Gems 2.

Outline Introduction to Fuzzy Logic Fuzzy Game AI Fuzzy Logic in CBR

Introducing Fuzzy Logic Takes into account the approximate nature of human reasoning – If the light is turned off, the room will be dark. How dark? Everything in Fuzzy logic is a matter of degree – Binary logic is fixed at a degree of 0 or 1, where fuzzy truth values can be anywhere in the range of [0,1]

Paradox of Self-Reference (just for fun) Liar paradox – “This sentence is false.” – In binary logic, X cannot equal ¬X. – We can use fuzzy logic and declare X to be (.5) false, so ¬((.5)X) = (.5)X. “This sentence is (half) false.” is (half) true. Epimenedes – A Cretan says: “All Cretans are liars.” – Perhaps he means with a truth value of.999

Fuzzy Membership Functions Fuzzy Logic extends multi-valued logic A function is defined for each logic value Instead of values being mutually exclusive like in a normal logic system, the logic values overlap.

Fuzzy Membership Functions Functions can be simple or complex (fuzzily speaking of course) Which functions could describe the fuzzy value, Tall?

Fuzzy Sets and Operations Fuzzy Set defined by function. – COLD(x) = 1 if temp(x)<= 50 (60 – temp(x))/10 if 50<temp(x)<60 0 if temp(x)>=60 – Negation ¬COLD(x) = 0 if temp(x)<= 50 (temp(x)-60)/10 if 50<temp(x)<60 1 if temp(x)>=60 The function and its inverse overlap!

Fuzzy Set Operation A AND B at x=4.75 A AND B = min(A,B) =.25 A OR B at x=4.75 A AND B = max(A,B) =.75

Fuzzy Logic or Probability Theory Fuzzy logic deals with the measure of how much a variable is in a particular set. Probability theory handles subjective probability where a function may map how likely a variable is to be in a particular set.

Fuzzy Logic in Game AI Fuzzy logic can be used in a variety of ways to help game AI seem more human-like NPC Finite State Machines can be improved by making fuzzy determinations for state transition logic

Example NPC FSM Character stays in state until distance value is crossed

FSM Rules FSM transition rules: State Chase – IF player is close THEN attack – ELSE IF player is far THEN returnHome – ELSE chase Close and far are crisply defined – Is necessary if distance is the only state transition measure

Fuzzy Rules cont’d Fuzzy rules might be – IF player is close THEN attack – IF player is far THEN returnHome – IF player is inbetween THEN chase Combined with other factors (weapon range, time of day, weather condition) a distance measured close may not be close enough The NPC now has more varied, interesting behavior

Fuzzy AI Decision Rules are created using every combination of 1 set from each variable. Rules may be difficult to produce. Variables can be given weights or rule base can be generated by expert.

Fuzzy AI Decision cont’d Each rule has an aggressiveness value (or truth value) using the Fuzzy AND operation. All-out attack is the best choice because is has the highest degree of truth, but there still is a small part of Fight defensively that wants to be considered. So…

Defuzzification Want to derive a numeric output value for aggressiveness. One method is the center-of- mass method Take the maximum value from each output variable set. (attack – 53, defend – 18, run – 0) Create a full output block by capping each membership function at the final output value, then OR the functions. Find the center of mass.

Combinatorial Explosion For real time AI, this becomes unpractical at a certain point. Can compromise some of the functionality to significantly reduce the number of rules.

The Combs Method Use rules based on each set’s relationship to the output. Take output from each rule fired, OR the matching sets to get the overall truth value for each output set. – (Run – 0, Defense – 83, Attack – 60) Different, but still reasonable – Aggressiveness values fairly close after defuzzification

Fuzzy AI Keep fuzziness in game AI on a small scale FuSM can be used where states don’t interfere with eachother. – Face modeling can be fuzzy to look more natural

Fuzzy CBR Think about CBR using fuzzy logic – Case is similar or not similar – Retrieval can be more accurate with fuzzy attributes (…symbolic attributes) – Case can be adapted using fuzzy set functions based on differences between problem case and retrieved case

Restaurant Example Ex’ple Bar Fri Hun PatAltTypewait x1 no yes some yesFrench yes x4 no yes full yes Thai yes x5 no yes no full yesFrench no x6 yes no yes some noItalianyes x7 yes no none noBurgerno x8 no yes some no Thaiyes x9 yes no full noBurgerno x10 yes full yesItalianno x11 noNo no none no Thaino

Restaurant Example Bar / No Bar doesn’t really work, but fuzzifying Hungry and Patrons could help – (starving, pretty hungry, a little hungry) Patrons seems to be begging for fuzziness. – Is the difference between None and Some really just 1 patron? – Does full actually mean there are no open tables whatsoever?

Fuzzy CBR Systems WIND-1 – Weather prediction for airports. Expert identifies fuzzy attributes (cloud ceiling, visibility, etc) – Expert defines similarity thresholds to measure sim between cases. Outputs are fuzzy. (Very near, near, slightly near) – Fuzzy predictor performs more accurately than system finding k-NN using crisp attribute values.

Fuzzy CBR Systems PROFIT – Fuzzy CBR system for real estate value estimation that uses fuzzy logic in similarity computation, case adaptation, and confidence value generation – Sale comparison approach: “finding the most similar houses, located close to the subject property, sold not too long ago; and selecting a balanced subset of the most promising comparables to derive the final estimate.”

Fuzzy CBR Systems cont’d (PROFIT) Similarity functions describing living area, lot size, preferred #bedrooms, and preferred #bathrooms

Fuzzy CBR Systems cont’d (PROFIT) Finds most similar cases, applies adjustment rule set using differences to subject case. Similarity rank could differ from net adjustment rank. Discard cases with too much price adjustment. Final estimate = sum(adjPrice*sim)/sum(sim) Confidence assessment using aggregation of fuzzy functions related to cases retrieved, similarity, average price adjustment, etc.

Conclusion Fuzzy logic helps represent vague variables and sets in a more natural Game AI can be altered using fuzzy state transitions and/or fuzzy states to add variance to NPCs In Case-Based Reasoning, the Retrieve and Revise steps can benefit from having fuzzy membership functions of case features.