# 蟻群算法應用在足球機器人的避障路徑上

Document Sample

```					Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(1/11)
    The procedure of GA-PSO algorithm can be described as follows:

   Step 1: Initialize the PSO algorithm by setting
F1 pbest  F2pbest   FNpbest  0 , g  1 the maximum
number of generation (G), the number of particles (N),
c1 , c2 
and four parameter values ,of max    min
and        .

1
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(2/11)
   Step 2: Generate the initial position vector
h          
p1  p1h ,1 , p1h ,2 ,           , p1h , j  ,       , p1h ,n    
and the initial velocity vector
h          
v1  v1h ,1 , v1h ,2 ,      , v1h , j  ,        , v1h ,n    
of N particles randomly by
j          
p1h , j   p min  p max  pmin rand ()
j        j                                         (12)

and

v1h, j    
v   max
j      v min 
j
rand ()
20                                                 (13)

2
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(3/11)
   Step 3: Calculate the fitness value of each particle in the g-th
generation by
F  ph   fit  ph  , h  1,2,
g            g
,N
Pbest
   Step 4: Determine F         Pbest
and ph for each particle by
h

 Fhg , if FhPbest  Fhg

F Pbest
  Pbest
h
 Fh , otherwise               (15)

h  1, 2, , N 

and
 ph , if FhPbest  Fhg

g

p Pbest
h         Pbest
 ph , otherwise
                            (16)
h  1, 2,     , N
3
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(4/11)
   Step 5: Find an index q of the particle with the highest fitness by

q  arg max FhPbest
h1,2, , N                    (17)
and determine F Gbest and PGbest by

F Gbest  FqPbest  max FhPbest          (18)
h1,2, , N 

and
pGbest  pq
Pbest                 (19)

4
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(5/11)
   Step 6: If g=G, then go to Step 12, Otherwise, go to Step 7.

   Step 7: Update the velocity vector of each particle by
vhg 1    vhg  c1  rand1()   pGbest  phg 
(20)
c2  rand 2()   p   Pbest
h       p  g
h   
 is a weight value and defined by
max  min
  max                          g
G                             (21)

5
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(6/11)
   Step 8: With fixed-length chromosomes that the problem is
variable domains, select the number of chromosome
population is  , the crossover rate is pc , the mutation
rate is pm .

   Step 9: The definition of adaptive function to measure the problem
domain on a single chromosome of the performance or
process, the basis for selecting pairs of chromosomes.

   Step 10: The size of a randomly generated initial population of
chromosomes  .
x1 , x2 ,   , x

6
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(7/11)
   Step 11: Calculating the adaptability of each chromosomes.

f  x1  , f  x2  ,   , f  x 

   Step 12: In the current population, select a pair of chromosomes.
Parental chromosomes are selected and their adaptability
related to the rate. Adaptive chromosomes are selected
with high rate is higher than the low adaptability of the
chromosomes.

   Step 13: Through the implementation of genetic operators-crossover
and mutation of a pair of offspring chromosomes.

7
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(8/11)
   Step 14: The offspring chromosomes into new populations.

   Step 15: Repeat step 13, unit the new chromosome population size
is equal to the size of initial population  .

   Step 16: With the new (offspring) chromosome populations to
replace to the initial (parent) chromosome populations.

   Step 17: Back to step 12, repeat this process until you meet the
conditions for ending to stop.

8
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(9/11)
   Step 18: Check the velocity constraint by

v max , if v gh1j  v max
 , 

j                           j

vgh1j   vgh1j  , if v min  vgh1j   v max
,            ,              j            ,    j     (22)
 min
v j        if vgh1j   v min
                  ,         j

h  1,2, , N , j  1,2, , n

   Step 19: Update the position vector of each particle by

ph 1  ph  vh 1
g       g    g
(23)

9
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(10/11)
   Step 20: Bound the updated position vector of each particle in the
searching range by

 p max ,         if   pgh, 1j   p max

j                                  j

pgh, 1j    pgh, 1j  ,   if   p min  pgh, 1j   p max
j                     j
 min                    g 1
(24)
 pj ,            if   p           p   min
                        h, j         j

h  1,2, , N ,                  j  1,2, , n

   Step 21: Let g=g+1 and go to Step 3.

10
Southern Taiwan University

GA-PSO Fuzzy Controller Design
Method(11/11)
   Step 22: Determine the corresponding fuzzy controller based on
Gbest
the position of the particle p       with the best fitness
value F Gbest .

   In the above reasoning, we will use the FIRA simulator to confirm the
results of our reasoning.

11
Southern Taiwan University

Simulation Results(1/2)
   The membership functions of d , a, y1 and y2 , as determined by the
proposed GA-PSO based method, are presented in figure 4.

(a)                       (b)                        (c)

Figure 4. membership functions of (a) e1 and e2 (b) e3 and e4
(c) y1 and y2 , as determined by the proposed GA-PSO method

12
Southern Taiwan University

Simulation Results(2/2)
   The figure 5 are the orbit of the soccer robot when controller by the
proposed GA-PSO method and simulation with a FIRA simulation.

Figure5. The soccer robot moving

13
Southern Taiwan University

Conclusions
   The final results showed that, although the GA-PSO's convergence
time is not the time than the PSO-based fast, and as we join the GA
algorithm , after the results obtained will be closer to its optimal
solution. In the future, we need to explore ways to let a faster
convergence time for change

14
Southern Taiwan University

15

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 24 posted: 12/4/2011 language: English pages: 15
liamei12345 http://