Simulation-Based Engineering of Complex Systems Dr. John R. Clymer, INCOSE Fellow
Module 5: Crisp & Fuzzy Rules
University of Waterloo October 6-7, 2010
1
Module 5: Crisp & Fuzzy Rules • Concept of Decision Making using Crisp & Fuzzy Rules in Complex Adaptive Systems (CAS) • Case Study & OpEMCSS Blocks: Air Traffic Control in OpEMCSS • Summary
2
Decision Making using Crisp & Fuzzy Rules • Rules Govern System Behavior • Rule Ambiguity in Crisp Rules • How Do Fuzzy Rules Work
3
Comparison of Rules Used So Far with Classifier Rules • Rules are used to decide system behavior in its environment: compute alternate attribute values and decision logic • Rules used so far are of the MODAL form: if(BooleanExpression) LOGIC = TRUE; else LOGIC = False;
• Classifier System block rules are of the form: Rule 1:IF AvgStrmCntNS = zero AND AvgStrmCntEW = zero, THEN Offset = zero, CF=50.0% 4
Transitioning From Analog Decision Making to Symbolic Reasoning • Analog attributes are of the form: AttributeName = RealValue
• Classifier feature facts are derived from attributes using the following type of command in the rule file LegalConditionVals(AvgStrmCntNS)=zero (0:5), medium(5:10),high(10:1000)
• LegalConditionVals command maps attribute values into symbolic feature facts or crisp sets AvgStrmCntNS=zero
• Crisp sets give analog values symbolic meaning 5
Governance by Crisp & Fuzzy Rules • Rules Govern System Behavior • Rule Ambiguity in Crisp Rules • How Do Fuzzy Rules Work
6
Situational Universe for a Classifier System • Situational Universe U for a classifier system is comprised of the set of all possible combinations of condition feature facts • A situation u is a subset of U and is described by combinations of condition facts – Situation u covers boxes 2&&4 – Simplest Rule for u is if (B=1) then Action u – Two more specific rules cover u If (A=0) && (B=1) then Action u If (A=1) && (B=1) then Action u
A=0
1
2
A=1
3
4
B=0
B=1 7
Situational Ambiguity • Ambiguity occurs when the situational universe U is inadequate to describe all situations unambiguously or generated rules are immature • Ambiguity results when several rules that specify different actions are eligible in the same decision context • Ambiguity is zero when one rule dominates and is 100% when several rules with different actions have the same rule confidence (Confidence Factor (CF)).
8
Example: Use of Rule Strength in Ambiguity Measurement 100 Ma x
CF 100
A Ambiguity = 200/(2*100),
B Max = 1
Alternate Rules
C
100 Ma x
CF 100
1
1 A B Ambiguity = 2/(2*100) approx. = 0.01
C
Alternate Rules 9
Ambiguity Results When Situations Overlap u1
A
u2
U
• Situations u1 and u2 have different actions and overlap in situational universe elements A • For ambiguous elements in set A, several rules will be eligible: choose rule with largest CF 10
Induction of Rules for Situation u Rules Overlap here
RULE1: IF NOT A AND D THEN ACTION u RULE2: IF B AND NOT C AND D THEN ACTION u
• Several rules are often required to cover all elements of situation u. • Rule induction aims to find the most general rules that cover all elements of situation u and no other situations. 11
Rule Search Proceeds from General to Specific
• Simulation generates example decision contexts which are used to test the rules • Good rules persist and bad rules are eliminated • A default hierarchy of rules results where all rules specify the correct action 12
Summary of Rule Induction • Starts with very general rules • Determines which rules are the best building blocks • Constructs more specific rules using the best rule tree building blocks • Generation stops for each decision situation element in subset u when rule ambiguity goes to zero – • Residual ambiguity indicates situational universe U is inadequate • Classifier block parameter AMBIGUITY specifies number of rules generated before ambiguity calculation begins.
13
Rule Induction Experiment
14
Input Event Action Block Reads in the Casefile and Passes the Attributes to the Classifier CASEFILE Outlook 1 1 2 3 3 3 2 1 1 3 1 2 2 3
Temp Humidity Windy Class 1 1 0 2 1 1 1 2 1 1 0 1 2 1 0 1 3 2 0 1 3 2 1 2 3 2 1 1 2 1 0 2 3 2 0 1 2 2 0 1 2 2 1 1 2 1 1 1 1 2 0 1 2 1 1 2
Case values are picked randomly and used to select row from the casefile. 15
Initial Rule File Specifies Conversion from Analog Values to Symbolic Values LegalConditionVals(Outlook)=Sunny(1:1),Overcast(2:2),Rain(3:3) LegalConditionVals(Temperature)=Hot(1:1),Mild(2:2),Cool(3:3) LegalConditionVals(Humidity)=High(1:1),Normal(2:2) LegalConditionVals(Windy)=False(0:0),True(1:1) LegalActionVals(Decision)=Plus(1:1),Minus(2:2) Decision is the value output from the Classifier and Class is the true value Rule 1:IF Windy = True, THEN Decision = Plus, CF=50.0% Rule 2:IF Windy = False, THEN Decision = Plus, CF=50.0%
• Sample of top level rule tree
• Initial building blocks
16
Induced Default Rule Hierarchy: Identify Cases Covered by Each Rule Rule1:IF Outlook=Overcast, THEN Decision=Plus, CF=100% Rule2:IF Humidity=Normal AND Windy=False, THEN Decision=Plus, CF=100% Rule3:IF Humidity=Normal AND Outlook=Sunny, THEN Decision=Plus, CF=100% Rule4:IF Humidity=High AND Outlook=Sunny, THEN Decision=Minus, CF=100% Rule5:IF Temperature=Mild AND Windy=True AND Humidity=Normal, THEN Decision=Plus, CF=100%
Rule6:IF Humidity=High AND Windy=True AND Temperature=Hot, THEN Decision=Minus, CF=100%
Rule10:IF Temperature=Mild AND Outlook=Rain AND Windy=True, THEN Decision=Minus, CF=100%
Rule7:IF Windy=False AND Outlook=Rain, THEN Decision=Plus, CF=100%
Rule11:IF Temperature=Cool AND Windy=False AND Outlook=Rain, THEN Decision=Plus, CF=100% Rule12:IF Outlook=Overcast AND Temperature=Cool AND Humidity=Normal, THEN Decision=Plus, CF=100%
Rule8:IF Outlook=Sunny AND Temperature=Hot, THEN Decision=Minus, CF=100% Rule9:IF Temperature=Cool AND Windy=True AND Outlook=Rain, THEN Decision=Minus, CF=100%
Rule13:IF Outlook=Rain AND Temperature=Cool AND Humidity=Normal AND Windy=False, THEN Decision=Plus, CF=100%
17
Governance by Crisp & Fuzzy Rules • Rules Govern System Behavior • Rule Ambiguity in Crisp Rules • How Do Fuzzy Rules Work
18
Comparison of Crisp and Fuzzy Sets • Crisp sets do not overlap
A
B
C Analog Value
• Fuzzy sets overlap
A
B
C Analog Value
19
Why Use Fuzzy Rules? X
Y System
• Input X is continuous real value or vector • Output Y is a continuous real value or vector • Want to map X to Y using rules – Implement non-linear control surface – Make use of expert specified rules 20
Degree of Fuzzy Set Membership 100% CF
0
C1 X’ A
C2
Domain X
Infinity
• As X’ varies along Domain X: CF increases to maximum as X’ goes from C 1 to A IF (X’ >= C1) && (X’ <= A) CF = 100*(X’-C1)/(A-C1)
CF decreases to zero as X’ goes from A to C 2 IF (X’ > A) && (X’ <= C2) CF = 100*(C2-X’))/(C2-A) 21
How Do Fuzzy Rules Work 100% CF
Medium
Zero
0
A1
If X’ = Zero Then Action = 1 If X’ = Medium Then Action = 2
X’ A2
Domain X
Infinity
• X’ is in both fuzzy sets Zero and Medium • The degree of fuzzy set membership of X’ is greater for Medium than for Zero – Action value will be closer to 2 than 1 – Action value will vary continuously as X’ increases. 22
Module 5: Crisp & Fuzzy Rules • Concept of Decision Making using Crisp & Fuzzy Rules in Complex Adaptive Systems (CAS) • Case Study & OpEMCSS Blocks: Air Traffic Control in OpEMCSS • Summary
23
Case Study: Air Traffic Control at Visual Flying Rules (VFR) Airport • Each aircraft is an intelligent agent • Aircraft share knowledge to decide takeoff and landing times • The OpEMCSS Classifier Block learns the rules that determine the scheduling of aircraft entering the approach corridor – Aircraft queue up west of the airport – Aircraft take turns entering the approach corridor – Aircraft enters corridor when no chance of overtaking aircraft ahead in the approach corridor 24
Airspace Animation Grid Shows Airport Scenario Including Approach Corridor
25
Study Approach • Goal is to generate a set of fuzzy rules to decide approach wait time • Use crisp rule definitions to generate a set of exemplars that provide the best action for each situational universe element u – Each element of the situational universe U is a unique combination of situational conditions – If situation ambiguous, several rules having different rule strengths result
• Use fuzzy rule definitions with crisp exemplars for fuzzy control of the airport 26
Airspace Model
Hierarchy Block encapsulates other OpEMCSS blocks
27
Contents of Hierarchical Block – Decide Approach Time
Context-Sensitive Event Action blocks (Search) obtain speed and time in approach corridor for closest aircraft ahead and returns speed and distance. • Local Event Action block computes closing velocity and correct time separation •
28
Classifier Block Icon and Display Dialog â&#x20AC;˘ Display dialog features decision display window, and it specifies the initial attribute to start inferencing (required for forward chaining), the reset attribute (used in reinforcement learning), and the decision ambiguity attribute.
29
Classifier Conditions and Actions Dialogs
•
Condition dialog specifies all condition attributes used in rules – Required in order to obtain value for a feature
•
Action dialog specifies all action attributes given a value as a result of rules 30
Classifier Learning Dialog Set to Learn Proper Action for each Rule Exemplar
Classifier learning dialog is shown in the rule learning mode . 31
Initial Crisp Rule Sets LegalConditionVals(Distance)=Closest(0:625), Close(625:1875), Near(1875:3500), Far(3500:6500), VeryFar(6500:13000), VeryVeryFar(13000:50000) LegalConditionVals(Speed)=Low(50:100), Medium(100:200), High(200:300), VeryHigh(300:1000) LegalConditionVals(ClosingVelocity)=Neg(-1000:-37.5), Zero(-37.5:37.5), Low(37.5:112.5), Medium(112.5:187.5), High(187.5:1000) LegalActionVals(AppDelayTime)=No_Wait(0:0), Wait_50(50:50), Wait_100(100:100), Wait_150(150:150), Wait_200(200:200), Wait_250(250:250) LegalActionVals(AppDelayTime)=Wait_300(300:300), Wait_350(350:350), Wait_400(400:400), Wait_450(450:450), Wait_500(500:500) â&#x20AC;˘ All combinations of condition symbolic values define a set of exemplars that cover the situational universe U 32
Crisp and Fuzzy Sets for Distance Feature CF NEAR CLOSEST CLOSE FAR
VERY FAR
VERY VERY FAR
100
0
2.5
5
7.5
10
15 DISTANCE, KFT
â&#x20AC;˘ Crisp sets are shown colored and used in exemplar rules as conditions. 33
Sample of Exemplar Rules Rule1:IF Distance=Close AND Speed=Low AND ClosingVelocity=Neg, THEN AppDelayTime=Wait_150,CF=50%
Rule3:IF Distance=Close AND Speed=Low AND ClosingVelocity=Low, THEN AppDelayTime=Wait_150,CF=50%
Rule2:IF Distance=Close AND Speed=Low AND ClosingVelocity=Zero, THEN AppDelayTime=Wait_150,CF=50%
Rule4:IF Distance=Close AND Speed=Low AND ClosingVelocity=Medium, THEN AppDelayTime=Wait_150,CF=50%
-
Using crisp rule definition only one rule is eligible
-
Using fuzzy rule definition eight exemplar rules will be eligible to compute action
Given any values of Distance, Speed, and ClosingVelocity: eight exemplar rules will be eligible to compute action when using fuzzy set definitions. â&#x20AC;˘
34
Computing Contribution of each Eligible Exemplar Rule
â&#x20AC;˘ CF for Conjunctive Condition is Minimum of Each Condition CF 35
Distance Condition Fuzzy Set Definitions LegalConditionVals(Distance)= Closest(-50000:1250), Close(0:2500), Near(1250:3750), Far(2500:7500), VeryFar(5000:15000), VeryVeryFar(10000:50000) ConditionFuzzySet(Distance)= Closest(-50000,0,1250) ConditionFuzzySet(Distance)= Close(1250,1250,1250) ConditionFuzzySet(Distance)= Near(2500,2500,1250) ConditionFuzzySet(Distance)= Far(5000,5000,2500) ConditionFuzzySet(Distance)= VeryFar(10000,10000,5000) ConditionFuzzySet(Distance)= VeryVeryFar(15000,50000,5000)
36
Distance Fuzzy Set Pictorial CF NEAR CLOSEST CLOSE FAR
VERY FAR VERY VERY FAR
100
0
2.5
5
7.5
10
15 DISTANCE, KFT
37
Speed Condition Fuzzy Set Definitions LegalConditionVals(Speed)= Low(-1000:150), Medium(50:250), High(150:350), VeryHigh(250:1000) ConditionFuzzySet(Speed)= Low(-1000,50,100) ConditionFuzzySet(Speed)= Medium(150,150,100) ConditionFuzzySet(Speed)= High(250,250,100) ConditionFuzzySet(Speed)= VeryHigh(350,1000,100)
38
Speed Fuzzy Set Pictorial CF LOW
MEDIUM
HIGH
VERY HIGH
100
50
150
250
350 SPEED, F/S
39
ClosingVelocity Condition Fuzzy Set Definitions LegalConditionVals(ClosingVelocity)= Neg(-1000:0), Zero(-75:75), Low(0:150), Medium(75:225), High(150:1000) ConditionFuzzySet(ClosingVelocity)= Neg(-1000,-75,75) ConditionFuzzySet(ClosingVelocity)= Zero(0,0,75) ConditionFuzzySet(ClosingVelocity)= Low(75,75,75) ConditionFuzzySet(ClosingVelocity)= Medium(150,150,75) ConditionFuzzySet(ClosingVelocity)= High(225,1000,75)
40
ClosingVelocity Fuzzy Set Pictorial CF NEG
-75
ZERO 100
LOW MEDIUM
HIGH
225 0 75 150 CLOSING-VELOCITY, FT/S
41
AppDelayTime Action Fuzzy Set Definitions LegalActionVals(AppDelayTime)= No_Wait(-50:50), Wait_50(0:100), Wait_100(50:150), Wait_150(100:200), Wait_200(150:250), Wait_250(200:300) LegalActionVals(AppDelayTime)= Wait_300(250:350), Wait_350(300:400), Wait_400(350:450), Wait_450(400:500), Wait_500(450:550) ActionFuzzySet(AppDelayTime)= No_Wait(0,0,50) ActionFuzzySet(AppDelayTime)= Wait_50(50,50,50) ActionFuzzySet(AppDelayTime)= Wait_100(100,100,50)
ActionFuzzySet(AppDelayTime)= Wait_150(150,150,50) ActionFuzzySet(AppDelayTime)= Wait_200(200,200,50) ActionFuzzySet(AppDelayTime)= Wait_250(250,250,50) ActionFuzzySet(AppDelayTime)= Wait_300(300,300,50) ActionFuzzySet(AppDelayTime)= Wait_350(350,350,50) ActionFuzzySet(AppDelayTime)= Wait_400(400,400,50) ActionFuzzySet(AppDelayTime)= Wait_450(450,450,50) ActionFuzzySet(AppDelayTime)= Wait_500(500,500,50)
42
Wait Time Fuzzy Set Pictorial CF WAIT50 WAIT150 NO_WAIT WAIT100 100
-50
0
50
100
150
WAIT450 WAIT400 WAIT500
200
350 400 450 500 550 WAIT TIME, SECONDS
43
Airspace Model Results Parametric equation based on fixed approach corridor Rules use based on application of Fuzzy Logic
• Rules generated two ways – Using an off-line program that generates all possible cases where each case is equally-likely – Using the airspace model to generate all possible cases where some cases are very rare
44
Design Procedure • Generate crisp rules for initial crisp set definitions – Crisp sets start and end at fuzzy crossover points – Crisp exemplar rules define best action for each situation defined in terms of these crisp sets
• Apply fuzzy set definition to crisp exemplar rules and notice situations where decisions are not good • Adjust fuzzy and crisp set definitions and try again until fuzzy rule decisions are good enough – Distance fuzzy sets are not symmetric
45
Conclusions • Key to good fuzzy rule decisions is proper fuzzy set definitions. • Given proper fuzzy sets, rule learning (rule generation turned off) adjusts rule strengths so that weighted averaging of action values produces a good decision for each situation. – Tune crisp exemplar rules used with fuzzy set definitions – Properly weight fuzzy rules in ambiguous situations
46
Module 5: Crisp & Fuzzy Rules • Concept of Decision Making using Crisp & Fuzzy Rules in Complex Adaptive Systems (CAS) • Case Study & OpEMCSS Blocks: Air Traffic Control in OpEMCSS • Summary
47
Summary of Module 5 • Learned about Decision Making using Crisp & Fuzzy Rules in Complex Adaptive Systems (CAS) • Studied case and OpEMCSS Blocks for Air Traffic Control • Each person introduced to the OpEMCSS modeling methodology
48