the matlab genetic algorithm toolbox

Upload: vurdalack666

Post on 04-Jun-2018

255 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    1/31

    The MATLABGenetic Algorithm Toolbox

    A

    .

    J. Chipperfield and P. J. Fleming 1

    1. Introduction

    Genetic algorithms (GAs) are stochastic global search and optimization methods that mimic the metaphor of naturalbiological evolution 1!. GAs operate on a population of potential solutions appl"ing the principle of survival of the

    .ttest to produce successivel" better appro#imations to a solution. At each generation of a GA$ a ne% set of

    appro#imations is created b" the process of selecting individuals according to their level of .tness in the problem

    domain and reproducing them using operators borro%ed from natural genetics. &his process leads to the evolution of

    populations of individuals that are better suited to their environment than the individuals from %hich the" %ere

    created$ 'ust as in natural adaptation.

    GAs have been sho%n to be an effective strateg" in the offline design of control s"stems b" a number of

    practitioners. For e#ample$ rishna*umar and Goldberg +! and ,ramlette and Cusin -! have demonstrated ho%

    genetic optimization methods can be used to derive superior controller structures in aerospace applications in less

    time (in terms of function evaluations) than traditional methods such as /0 and Po%ells gain set design. Porter and

    2ohamed 3! have presented schemes for the genetic design of multivariable .ight control s"stems using

    eigenstructure assignment$ %hilst others have demonstrated ho% GAs can be used in the selection of controllerstructures 4!.

    2. The MATLABGA Toolbox

    5hilst there e#ist man" good publicdomain genetic algorithm pac*ages$ such as G676898:! and G67;&

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    2/31

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    3/31

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    4/31

    ranking

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    5/31

    .

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    6/31

    Selection #unctions! reins$ rws$ select$ sus

    &hese functions select a given number of individuals from the current population$ according to

    their fitness$ and return a column vector to their indices. Currentl" available routines are roulette

    %heel selection !$ rws$ and stochastic universal sampling 11!$ sus. A highlevel entr"

    function$ select$ is also provided as a convenient interface to the selection routines$ particularl"%here multiple populations are used. ;n cases %here a generation gap is reDuired$ i.e. %here the

    entire population is not reproduced in each generation$ reins can be used to effect uniformrandom or fitnessbased reinsertion !.$rosso%er oerators! recdis$ recint$ reclin$ recmut$ recombin$ xovdp$ xovdprs$xovmp$ xovsh$ xovshrs$ xovsp$ xovsprs

    &he crossover routines recombine pairs of individuals %ith given probabilit" to produce offspring.

    8inglepoint$ doublepoint 1+! and shuffle crossover 1-! are implemented in the routines

    xovsp$ xovdp and xovsh respectivel". 0educed surrogate 1-! crossover is supported %ithboth single$ xovsprs$ and doublepoint$ xovdprs$ crossover and %ith shuffle$ xovshrs. Ageneral multipoint crossover routine$ xovmp$ that supports uniform crossover 13! is also

    provided. &o support realvalued chromosome representations$ discrete$ intermediate and line

    recombination are supplied in the routines$ recdis$ recint and reclin respectivel" 14!. &heroutine recmut performs line recombination %ith mutation features 14!. A highlevel entr"function to all the crossover operators supporting multiple subpopulations is provided b" the

    function recombin.

    Mutation oerators! mut$ mutate$mutbga,inar" and integer mutation are performed b" the routine mut. 0ealvalue mutation is availableusing the breeder GA mutation function 14!$ mutbga. Again$ a highlevel entr" function$mutate$ to the mutation operators is provided.Multile suboulation suort! migrate

    &he GA &oolbo# provides support for multiple subpopulations through the use of highlevel

    genetic operator functions and a function for e#changing individuals amongst subpopulations$

    migrate. A single population is divided into a number of subpopulations b" modif"ing the datastructures used b" the &oolbo# routines such that subpopulations are stored in contiguous bloc*s

    %ithin each data element. &he highlevel routines$ such as select and reins$ operateindependentl" on each subpopulation contained in a data structure allo%ing each subpopulation toevolve in isolation from the others. ,ased on theIslandorMigrationmodel 1:!$ migrateallo%sindividuals to be transferred bet%een subpopulations. Bni and bidirectional ring topologies as

    %ell as a full" interconnected net%or* are selectable via option settings as %ell as fitnessbased

    and uniform selection and reinsertion strategies.

    2.& A Simle GA in MATLAB

    Fig.1 sho%s the 2A&A, code for a 8imple GA. &he first fe% lines of the code set the

    parameters that the GA uses$ such as the number and length of the chromosomes$ the crossover

    and mutation rates$ the number of generations and$ in this case$ the binar" representation scheme.

    7e#t$ an initial uniforml" distributed random binar" population$ Chrom$ is created using the GA&oolbo# function crtbp. &he ob'ective function$ objfun$ is then evaluated to produce the vectorof ob'ective values$ ObjV. 7ote that as %e do not need the phenot"pic representation inside the

    GA$ the binar" strings are converted to real values %ithin the ob'ective function call.&he initialisation complete$ the GA no% enters the generational loop. First$ a fitness vector$ FitnV$is determined using the ran*ing scheme of ,a*er 11!. isualisation and preference articulation

    can be incorporated into the generational loop b" the addition of e#tra functions. ;n this e#ample$

    the routine plotgraphicsdispla"s the performance of the current best controller allo%ing theuser to asses the state of the search. ;ndividuals are then selected from the population using the

    stochastic universal sampling algorithm$ sus$ %ith a generation gap$ GGA !"#$. &he -: (GGA % &'&() selected individuals are then recombined using singlepointcrossover$ xovsp$ applied %ith probabilit" )OV ! "#*. ,inar" mutation$ mut$ is then appliedto the offspring %ith probabilit" +,-. ! "#"/*0$ and the ob'ective function values for the ne%individuals$ ObjV1el$ calculated. Finall"$ the ne% individuals are reinserted in the population$using the &oolbo# function reins$ and the generation counter$ gen$ incremented.&he GA terminates after +A)G& iterations around the generational loop. &he current

    population$ its phenot"pic representation and associated cost function values remain in the users

    %or*space and ma" be anal"sed directl" using 2A&A, commands.

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    7/31

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    8/31

    3'&( ! /04 5 3ength of individual vars

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    9/31

    #

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    10/31

    &VA. ! 24 5 &o# of decision variable

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    11/31

    s

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    12/31

    &'&( ! 6"4 5 &o# of individual

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    13/31

    s

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    14/31

    GGA ! "#$4 5 Generation ga

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    15/31

    p

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    16/31

    )OV ! "#*4 5 Crossover rat

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    17/31

    e

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    18/31

    +,-. ! "#"/*04 5 +utation rat

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    19/31

    e

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    20/31

    +A)G& ! 7"4 5 &o# of generation

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    21/31

    s

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    22/31

    including

    H parametric

    optimization

    H multiob'ective optimization

    H controller structure

    selection

    H nonlinear s"stem

    identi.cationH mi#edmode

    modelling

    H neural net%or* design

    H realtime and

    adaptive control

    H parallel genetic algorithms

    H fault identi.cation H antenna design 5 8inar9 representation scheme Field( !:3'&( 3'&(4 / /4 /""" /"""4 / /4 " "4 " "4 " ";4 5 'nitialisepopulation Chrom ! crtbp&VA.?4 5 Create binar9population ObjV ! objfun

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    23/31

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    24/31

    for ver" different genot"pes to result in nondominated individuals$ a particular problem is the production of

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    25/31

    lethals

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    26/31

    %hen

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    27/31

    .

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    28/31

    t members of the population are mated. &he search then becomes inef

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    29/31

    .

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    30/31

    cient and the GA is li*el" to converge to some suboptimal solution. ;n general$ a combination of mating restriction$

    niche formation and redundant coding ma" be appropriate.

  • 8/13/2019 The MATLAB Genetic Algorithm Toolbox

    31/31

    1=!

    C. 2. Fonseca and P. J. Fleming$ IGenetic Algorithms for 2ultiple $ 1>.

    3! ,. Porter and 8. 8. 2ohamed$ IGenetic ?esign of 2ultivariable FlightControl 8"stems Bsing 6igenstructure

    Assignment$Proc. I&&& Conf. Aerospace Control Sste!s$ 1-.

    4! A. arse*$ &. Brbacic and ,. Filipic$ IGenetic Algorithms in Controller ?esign and &uning$ I&&& 'rans. Ss.

    Man and Cber.$ ol. +-$ 7o. 4$ pp1--1--$ 1-.

    :! J. J. Grefenstette$ IA Bsers Guide to G6768;8ersion 4.$ &echnical 0eport$ 7av" Centre for Applied 0esearch

    in Artificial ;ntelligence$ 5ashington ?.C.$ B8A$ 1.

    =! ?. 5hitle"$ I&he G67;&.

    1! J. 6. ,a*er J$ IAdaptive 8election 2ethods for Genetic Algorithms$Proc. ICGA *$ pp. 11111$ 1>4.

    11! J. 6. ,a*er$ I0educing bias and inefficienc" in the selection algorithm$Proc. ICGA +$ pp. 13+1$ 1>=.

    1+! . ,oo*er$ I;mproving search in genetic algorithms$ ;n Genetic Algorith!s and Si!ulated Annealing$ . ?avis

    (6d.)$ pp :1=-$ 2organ aufmann Publishers$ 1>=.

    1-! 0. A. Caruana$ . A. 6shelman and J. ?. 8chaffer$ I0epresentation and hidden bias ;; 6liminating defining

    length bias in genetic search via shuffle crossover$ ;n &leventh Int. "oint Conf. on AI$ 8ridharan 7. 8. (6d.)$ ol. 1$

    pp =4=44$ 2organ aufmann$ 1>.

    13! G. 8"s%erda$ IBniform crossover in genetic algorithms$Proc. ICGA %$ pp. +$ 1>.

    14! K. 2Lhlenbein and ?. 8chlier*ampoosen$ IPredictive 2odels for the ,reeder Genetic Algorithm$

    &volutionar Co!putation$ ol. 1$ 7o. 1$ pp. +43$ 1-.

    1:! C. ,. Pett"$ 2. 0. euze. and J. J. Grefenstette$ IA Parallel Genetic Algorithm$ Proc. ICGA +$ pp. 1441:1$

    1>=.