Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fuzzy Logic and its Application to Web Caching By P.M.Pavan Kiran.

Similar presentations


Presentation on theme: "Fuzzy Logic and its Application to Web Caching By P.M.Pavan Kiran."— Presentation transcript:

1 Fuzzy Logic and its Application to Web Caching By P.M.Pavan Kiran

2 What is fuzzy logic? A type of logic that recognizes more than simple true and false values. With fuzzy logic, propositions can be represented with degrees of truthfulness and falsehood.

3 A Simple Example The Statement Today is sunny can be 100% true if there are no clouds 80% true if there are a few clouds 50% true if it's hazy and 0% true if it rains all day

4 Classical Set young = { x  P | age(x)  20 } characteristic function:  young (x) = 1 : age(x)  20 0 : age(x) > 20 A=“young” x [years]  young (x) 1 0 {

5 Fuzzy Set Classical Logic Element x belongs to set A or it does not:  (x)  {0,1} A=“young” x [years]  A (x) 1 0 Fuzzy Logic Element x belongs to set A with a certain degree of membership:  (x)  [0,1] A=“young” x [years]  A (x) 1 0

6 Types of Membership Functions x  (x) 1 0 abcd Trapezoid: x  (x) 1 0 ab Singleton: (a,1) and (b,0.5) x  (x) 1 0 abd Triangular:

7 Operators on Fuzzy Sets Union x 1 0  A  B (x)=min{  A (x),  B (x)}  A (x)  B (x) x 1 0  A  B (x)=max{  A (x),  B (x)}  A (x)  B (x) Intersection x 1 0  A  B (x)=  A (x)   B (x)  A (x)  B (x) x 1 0  A  B (x)=min{1,  A (x)+  B (x)}  A (x)  B (x)

8 Fuzzy Sets & Linguistic Variables A linguistic variable combines several fuzzy sets. linguistic variable : temperature linguistics terms (fuzzy sets) : { cold, warm, hot } x [C]  (x) 1 0  cold  warm  hot 6020

9 Fuzzy Rules causal dependencies can be expressed in form of if-then- rules general form: if then example: if temperature is cold and oil is cheap then heating is high linguistic values/terms (fuzzy sets)linguistic variables

10 if temperature is cold and oil price is low then heating is high if temperature is hot and oil price is normal then heating is low Fuzzy Rule Base Temperature : coldwarmhot Oil price: cheap normal expensive highhighmedium highmediumlow mediumlowlow Heating

11 fuzzy knowledge base Fuzzy Data-Base: Definition of linguistic input and output variables Definition of fuzzy membership functions Fuzzy Knowledge Base Fuzzy Rule-Base: if temperature is cold and oil price is cheap then heating is high …. x [C]  (x) 1 0  cold  warm  hot 6020

12 An Example In order to illustrate some basic concepts in Fuzzy Logic, consider a simplified example of a thermostat controlling a heater fan illustrated in Figure 1. The room temperature detected through a sensor is input to a controller which outputs a control force to adjust the heater fan speed.

13 Conventional Thermostat A conventional thermostat works like an on-off switch (Figure 2). If we set it at 78oF then the heater is activated only when the temperature falls below 75oF. When it reaches 81oF the heater is turned off. As a result the desired room temperature is either too warm or too hot.

14 Fuzzy Thermostat A fuzzy thermostat works in shades of gray where the temperature is treated as a series of overlapping ranges. For example, 78oF is 60% warm and 20% hot. The controller is programmed with simple if-then rules that tell the heater fan how fast to run. As a result, when the temperature changes the fan speed will continuously adjust to keep the temperature at the desired level.

15 Figure 2

16 Designing a Fuzzy Controller Our first step in designing such a fuzzy controller is to characterize the range of values for the input and output variables of the controller Then we assign labels such as cool for the temperature and high for the fan speed, and we write a set of simple English-like rules to control the system..

17 Design Contd….. Inside the controller all temperature regulating actions will be based on how the current room temperature falls into these ranges and the rules describing the system behavior. The controller's output will vary continuously to adjust the fan speed

18 The Rule Base The temperature controller described above can be defined in four simple rules: IF temperature IS cold THEN fan_speed IS high IF temperature IS cool THEN fan_speed IS medium IF temperature IS warm THEN fan_speed IS low IF temperature IS hot THEN fan_speed IS zero

19 The Process A fuzzy controller works similar to a conventional system: it accepts an input value, performs some calculations, and generates an output value. This process is called the Fuzzy Inference Process and works in three steps illustrated in Figure 3: (a) Fuzzification where a crisp input is translated into a fuzzy value, (b) Rule Evaluation, where the fuzzy output truth values are computed, and (c) Defuzzification where the fuzzy output is translated to a crisp value.

20 Fuzzification During the fuzzification step the crisp temperature value of 78oF is input and translated into fuzzy truth values. For this example, 78oF is fuzzified into warm with truth value 0.6 (or 60%) and hot with truth value 0.2 (or 20%).

21 Rule Evaluation For 78oF only the last two of the four rules will fire. IF temperature IS warm THEN fan_speed IS low with truth value 0.6 IF temperature IS hot THEN fan_speed IS zero with truth value 0.2

22 Defuzzification During the defuzzification step the 60% low and 20% zero labels are combined using a calculation method called the Center of Gravity (COG) in order to produce the crisp output value of 13.5 RPM for the fan speed

23 The Steam turbine Contrller

24 The Membership functions

25 The Rule Base rule 1: IF temperature IS cool AND pressure IS weak, THEN throttle is P3. rule 2: IF temperature IS cool AND pressure IS low, THEN throttle is P2. rule 3: IF temperature IS cool AND pressure IS ok, THEN throttle is Z. rule 4: IF temperature IS cool AND pressure IS strong, THEN throttle is N2.

26 Fuzzification and Rule Inferencing

27

28 Defuzzification

29 Why Web Caching? It is widely recognized that slow web sites are primary source of user dissatisfaction. Web Caching is a mechanism widely employed to reduce the latency to retrieve web pages.

30 What is web Caching? The idea of web caching is to store popular web objects “closer” to the user who requests them such that they can be retrieved faster. Caching also has the effect of reducing the load on the web servers and traffic over network.

31 Web Caching Web caching can be implemented at different levels They are 1.Client 2.Server 3.Network

32 Web Caching The web server and web browser are responsible for caching at server and client side respectively. Proxy servers are used for caching at the network level. A proxy server acts as an intermediary between clients and web servers.

33 Proxy server Many organizations use proxy servers in front of their LANs to save network bandwidth and speed up web page requests serving them locally. Upon receiving requests from multiple clients the proxy server checks from its cache whether the page is already present.

34 Proxy Server In Case of a cache miss the proxy server forwards the request to the web server. Once the page is returned by the server, the proxy sends it back to the client and stores a copy in the local cache for further requests. If the cache is full one or more pages have to be evicted from the cache.

35 The Replacement Policies The efficiency and performance of proxy caches depend on their design and management. Replacement policies play a key role for effectiveness of caching. The goal of these policies is to make best use of the available resources by dynamically selecting the pages to cached or evictes.

36 The fuzzy Database for web caching 1. Identification of the input output variables. 2. Definition of the membership functions. 3. Construction of the rule base.

37 The Variables The proper choice of process state input variable is essential to the characterization of the operation of a fuzzy system. Three variables as input are chosen, they being Size, Frequency of access, Access recency, i.e time elapsed since the last access.

38 The Variables The output variable is probability of replacement. The membership functions of each of these variables is plotted from the analysis of various proxy servers and their workloads.

39 The Membership functions

40 The rule base

41 The process Measurement of the values of the input data from the server. Fuzzification Inference from fuzzy rules using Max-Min Inference. Defuzzification using the COG method.

42 The performance

43 The End Thank You


Download ppt "Fuzzy Logic and its Application to Web Caching By P.M.Pavan Kiran."

Similar presentations


Ads by Google