Tipping Problem Revisited By louay alazazmeh Q 1
Tipping Problem Revisited By: louay alazazmeh
Q 1 - if you want to give a tip for a waiter, what is the input that determine the tipping value? Q 2 - for the same case, what is the rule that you should follow to give that tipping ? Q 3 - what do you think of the output of this process(tipping), and how much one is there are ?
In this example we will review two inputs, one output, three rules to try solving this tipping rule. Inputs : 1 - service (0 -10) 2 - food (0 -10) Outputs: 1 - tip (5 -25%) Rules: 1 -if service is poor or food is rancid then tip is cheap. 2 - if service is good, then tip is average. 3 - if service is excellent or food is delicious, then tip is generous.
-This is the way of problem solving … -Information flows from left to right, from two inputs to a single output. The parallel nature of the rules is one of the more important aspects of fuzzy logic systems.
Step 1. Fuzzify Inputs -The first step is to take the inputs and determine the degree to which they belong to each of the appropriate fuzzy sets via membership functions. -Before the rules can be evaluated, the inputs must be fuzzified according to each of these linguistic sets.
Step 2. Apply Fuzzy Operator After the inputs are fuzzified, you know the degree to which each part of the antecedent is satisfied for each rule. The following figure shows the OR operator max at work, evaluating the antecedent of the rule 3 for the tipping calculation.
Step 3. Apply Implication Method Before applying the implication method, you must determine the rule's weight. Every rule has a weight (a number between 0 and 1), which is applied to the number given by the antecedent.
Step 4. Aggregate All Outputs Because decisions are based on the testing of all of the rules in an FIS, the rules must be combined in some manner in order to make a decision. Aggregation is the process by which the fuzzy sets that represent the outputs of each rule are combined into a single fuzzy set.
Step 5. Defuzzify The input for the defuzzification process is a fuzzy set (the aggregate output fuzzy set) and the output is a single number. As much as fuzziness helps the rule evaluation during the intermediate steps, the final desired output for each variable is generally a single number.
Building Systems with Fuzzy Logic Toolbox There are five primary GUI tools for building, editing, and observing fuzzy inference systems in Fuzzy Logic Toolbox: Fuzzy Inference System (FIS) Editor Membership Function Editor Rule Viewer Surface Viewer.
The FIS Editor
The diagram is updated to reflect the new names of the input and output variables. There is now a new variable in the workspace called tipper that contains all the information about this system. By saving to the workspace with a new name, you also rename the entire system. Your window looks something like the following diagram.
The Membership Function Editor
Use triangular membership function types for the output. First, set the Range (and the Display Range) to [0 30], to cover the output range. Initially, the cheap membership function has the parameters [0 5 10], the average membership function are[10 15 20], and the generous membership function are [20 25 30]. Your system should look similar to the following figure.
The Rule Editor
- Slides: 18