PDF format

10 downloads 0 Views 97KB Size Report
Noboru Endou†. Akihiko Uchibori††. Katsumi ... Tokiwadai Ube, Yamaguchi, JAPAN [email protected] ... NOBORU ENDOU et al. event and they were so ...
MECHANIZED MATHEMATICS AND ITS APPLICATIONS, VOL. 1, NO. 1, JUNE 2000, 39:45

An Optimization of Fuzzy Logic by using Genetic Algorithm Noboru Endou†

Akihiko Uchibori††

Katsumi Wasaki†



Shinshu University, Faculty of Engineering Department of Information Engineering Nagano-shi Wakasato 4-17-1, Nagano-ken 380-8553 JAPAN {xendo,wasaki}@cs.shinshu-u.ac.jp ††

Ube National College of Technology Department of Mechanical Engineering Tokiwadai Ube, Yamaguchi, JAPAN [email protected] Abstract - We consider an optimization of fuzzy logic by using the Genetic Algorithm (GA). The convergence of this algorithm can be derived from the compactness of the set of fuzzy membership functions.

1.

Introduction

For the work of an optimizing fuzzy logic, we consider the convergence of the Genetic Algorithm (GA) by examining a simple survival game as an example. The convergence of this algorithm can be derived from the compactness of a set of membership functions which define the production rules. By the continuity of the cost function, the existence of an optimal solution is assured. The production rules used in fuzzy logic are implemented with membership functions. In general, optimizing these functions is very difficult. So many researchers are pursuing the work of developing optimization techniques ([1][2][3]). In considering the convergence of the GA, it is necessary to investigate the convergence of an infinite sequence of the set of membership functions used in this algorithm. Therefore, the compactness of the sequence is very important and can be derived from the Arzelà-Ascoli theorem. The existence of the feasible solutions is also assured from the Polak's Relaxed Controls theorem ([4]). Moreover, as our previous work, we have proved a Mizar article, which is related to the Genetic Algorithm ([5]). By using this article, this result will be proved by the Mizar Checker.

2.

Description of Simulation Scenario

We consider the following simple scenario: There are mosquitoes in our simple virtual world. They want fresh blood of animals to satisfy their hunger. One day, one of the mosquitoes wandered around an animal. But, the animal was very cross and the unfortunate mosquito was squashed and killed instantly. Other mosquitoes witness the

39

40

NOBORU ENDOU et al.

event and they were so afraid to be killed like him. One mosquito decided to approach the animal very carefully. Even a slight movement by the animal was enough to make her stop approaching so she could not get very close to it. Presently she began to lose her health gradually because of her malnutrition. The others were also troubled about their food; if they got too close to the animal, they would be killed. But being too careful would mean they would go hungry. In addition, they must make children because they cannot live forever. They want to leave descendants of a healthy partner. To stay healthy, they must get food. To get food, they need to go near an animal. But they do not want to be killed. They are troubled day after day, going near and around animals.

3.

Fuzzy Logic

By using a fuzzy logic, the mosquitoes in our virtual world (see Section 2) decide how close they will approach an animal. If they are too far away from the animal, they have to get closer. If they are too close, they have to get farther away. They try not to get too near to a dangerous or nervous animal and try to approach only safe animals, which are napping, for example. If-then type rules are given by the following conditions: Rule1: If there is little distance from the animal then the mosquito gets away from it. Rule2: If there is much distance to the animal then the mosquito goes nearer to it. Rule3: If the animal is dangerous then the mosquito gets away from it. Rule4: If the animal is safe then the mosquito goes nearer to it. Then the condition rules are configured as follows (Fig.1), Rule1:, µif 1( d ) = 1 −

d −a , d ∈ [ a, b] b−a

Rule2: µif 2( d ) =

d −a , d ∈ [ a, b] , b−a

Rule3:, µif 3(α ) =

α − a' , α ∈ [ a ' , b' ] b'− a'

Rule4: µif 4 (α ) = 1 −

α − a' , α ∈ [ a ' , b' ] , b'− a'

where [ a, b] is the range of distance d between the animal and the mosquito and [ a ' , b' ] is the range of the intensity α of the risk of the animal. The consequence rules are given as elements in a set F(Δ,δ) of functions defined as follows:

41

AN OPTIMIZATION OF FUZZY LOGIC BY USING GENETIC ALGORITHM

∆, δ > 0 F (∆, δ ) ≡ {µ : [−c, c] → [0,1], ∀x, x'∈ [−c, c], | µ ( x) − µ ( x' ) |≤ ∆ | x − x' |, min µ ( x) ≥ δ }, x∈[ − c ,c ]

where [ −c, c] is the range of distance that the mosquitoes can move.

Negative values

represent moving away from the animal. This set of functions includes almost all the fuzzy membership functions frequently used.

μif2

μif1

a

b

d

a

Rule1

b

d

b'

α

Rule2 μif4

μif3

a'

b'

α

a'

Rule3

Rule4 Figure 1.

To adjust the values of the condition rule, the upper portion of the consequence rule is cut. Then, the logical sum of all consequence rules is taken and the moment mµ is calculated by the following function m .

∫ = ∫

c

m : µ ∈ F (∆, δ ) a mµ

−c c

xµ ( x)dx

−c

µ ( x)dx

.

Fig. 2 shows this process. The obtained mµ decide the motion of the mosquito. If mµ is positive, the mosquito goes ahead. On the other hand, if mµ is negative, the mosquito retreats.

4.

Genetic Algorithm

Each mosquito has a different fitness J based on its behavior. given by

This fitness J is

42

NOBORU ENDOU et al.

J=

p(d − mµ ) 2 + qr 2 ,

p, q : constant where r is the intensity of the risk to which mosquitoes are exposed. The value of r is directly proportional to the intensity of the motion α of an animal (a nervous animal is always moving) and inversely proportional to the distance d between the animal and a mosquito. That is, r is given by

r=

α . d

Condition Rules

Consequence Rules

Rule 1

a

b

-c

a

b

-c

c

Rule 2 c

Rule 3 a'

b'

-c

c

Rule 4 a' b' -c c                                    Moment Logical Sum of Consequence Rules

-c

c

Figure 2. In order for the mosquito to have high fitness, it must go near the animal to places with low risk. However, the distance and the risk have a tradeoff relationship. A more adaptable

AN OPTIMIZATION OF FUZZY LOGIC BY USING GENETIC ALGORITHM

43

mosquito has a greater possibility for making children since it is healthier. Therefore, after a number of generations, they will have even higher fitness. The mosquitoes make their children using genes that are created by coding the consequence rule functions (Fig. 3). Consequence Rule function

   

a2       

a3

a1 -c

c gene a2

a1

a3 Figure 3.

The child mosquitoes can take the crossed and/or mutated genes of their parents. In addition, only the mosquitoes with the highest fitness can leave his clones in the next generation. The algorithm of GA is as follows: Algorithm 1. Create a set G 0 of some mosquitoes which have chromosomes generated at random. Set i = 0. Compute fitness J 0 . 2. Allow them to live in various environments with various distance and risk between them and the animal. 3. Compute fitness Ji. If

∑J

i −1

< ∑ Ji then go to step 4, else go to step 5.

4. Based on their fitness, make a new generation Gi from Gi − 1 using the methods of cross and mutation. Set i = i + 1 . Go to step 2. 5. Stop this algorithm.

5.

Result of Simulation

Fig. 4 shows the results of simulation. If multiple mosquitoes are displayed at the same points, the dots have been drawn large and the x-axis indicates the number of generation changes. The y-axis indicates the fitness of the mosquitoes.

44

NOBORU ENDOU et al.

       Figure 4.

6.

Convergency

We think of these groups of fitness as the accumulation points of a set of fuzzy membership functions. This implies that an infinite sequence generated by this algorithm has an accumulation point. The set F ( ∆, δ ) is compact for the uniform topology as a subset of all continuous functions on [ −c, c] . theorem.

This compactness can be clearly derived from the Arzelà-Ascoli

Let {µn} be an infinite sequence in the set F ( ∆, δ ) .

Then, there exist a

membership function µ∞ ∈ F ( ∆, δ ) and a subsequence {µnk} of {μn} converging to µ∞ uniformly. This implies that the sequence {µn} has a number of accumulation points. From Polak's Relaxed Controls theorem ([4]), it is expected that this algorithm will have feasible solutions of JG (G ) = ΣJ . Here, the feasible solution of JG (G ) is the set G, which gives a maximal value of J (G ) . For the help of readers, we refer to Polak's Relaxed Controls theorem as follows: The notation Π represents a set of mosquito's generation. Moreover, we define functions a and JG such that

a : Π → Π , JG : Π → R . Then next theorem is true ([4]). Theorem. Assume that the functions a and JG satisfy the following conditions. (i)

J (G ) is bounded above.

AN OPTIMIZATION OF FUZZY LOGIC BY USING GENETIC ALGORITHM

(ii)

45

(∀G ∈ Π; Non - feasible solutions), ∃ε (G ), ∃δ (G ) > 0, ∀G '∈ B(G, ε (G )), J (a(G ' )) − J (G ' ) ≥ δ (G ) > 0, where B (G , ε ) = {G '∈ Π | D (G ' , G ) ≤ ε } , and D is the summation of the distance between a mosquito's genes in G and G ' .

Then, either the sequence {Gi} constructed by the algorithm (see Section 4) is finite and its last element is a feasible solution, or else it is infinite and every accumulation point of

{Gi} is a feasible solution. Thus, it is assured that the algorithm has feasible solutions.

7.

Conclusion

In optimizing fuzzy logic with GA, we considered the convergence and the existence of the optimal solution of the algorithm. The convergence can be determined from the compactness of the set of membership functions which define the production rules. Moreover, the existence of feasible solutions is assured from the Polak's Relaxed Controls theorem. The membership functions for this algorithm need some restrictions, but we believe that they need not be very strict.

References [1] C. L. Karr, Design of an Adaptive Fuzzy Logic Controller Using a Genetic Algorithm, Proc. of 4th Int. Conf. on Genetic Algorithm, 1991, pp. 450-457. [2] H. Tamaki, The Method of Evolutionary Algorithm, Journal of Japan Society for Fuzzy Theory and Systems, 1998, pp. 593-601. [3] H. Takagi, Cooperation between the Genetic Algorithm and Fuzzy Theory, Journal of Japan Society for Fuzzy Theory and Systems, 1991, pp. 602-612. [4] E. Polak, Computational Methods in Optimization, New York, Academic, 1971. [5] A. Uchibori and N. Endou, Basic Properties of Genetic Algorithm, Formalized Mathematics (to appear), Vol. 11, No. 26, 1999.