Intern ati o n a l Jo urn a o f  R o botics   a nd Au tom a tion   (I JR A)   V o l.  3, N o . 3 ,  Sep t em b e r   2014 , pp . 20 1 ~ 21 I S SN : 208 9-4 8 5 6           2 01     Jo urn a l  h o me pa ge : h ttp ://iaesjo u r na l.com/ o n lin e/ind e x.ph p / IJRA  Controlling Bloat in Genetic  Programming for Sloving Wall  Following Problem         Na vid B a z r ka r, M o s t a f Ne mati,  Rez a   Sal i mi   Com puter S c ien ce Dep a rtm e nt Ta bar i  Univ ersity , Babo l, Iran       Article Info    A B STRAC T Article histo r y:  Received Sep 5, 2013  Rev i sed  Jun  20,  201 Accepte J u l 15, 2014      The go al in  auto m a tic progr am ming is to g e co m puter to per f or m  a task  b y   telling it what  needs to be do ne, ra ther than b y  explicitly   pr ogramming  it.W ith  consider s the task of  aut o m a tica l l y  gen e r a ting  a com puter  program  to   enable an  autono mous mobile robot to  p e rform the task of followin g the wall  of an irregular s h aped room. During th e evolutio n of solutions using genetic  program m i ng (GP )  there is  gener a ll y an in cre a s e  in averag e tre e  s i ze withou t   a corresponding  increase in fitn ess- a phenomenon commonly  referred to as   bloat. Man y  diff erent blo a t contr o l me thods have been proposed.  This paper   review,  evalu a te, implementatio n  and  comparison of these methods in wall  following problem and the most appropriate method for solving bloat  problem is prop osed.   Keyword:  Aut o m a ti c pr o g ram m i ng  Co n t ro llin g b l oat   Genet i c  pr o g ra m m i ng    Wall fo llo wi n g  prob lem     Copyright ©  201 4 Institut e  o f   Ad vanced  Engin eer ing and S c i e nce.  All rights re se rve d Co rresp ond i ng  Autho r Mostafa Nem a ti,    C o m put er Sci e nce  Depa rt m e nt , Taba ri  U n i v e r si t y   M a nji l ,  B a har   Ave ,  P: 67 , Ta b a ri  B a b o l ,   Ira n   Em a il: Mo stafa.m a n j il@g m a il.co m       1.   INTRODUCTION   Gen e tic Prog rammin g  (GP) is th e au to m a ted  learn i ng  o f  co m put er pro g r a m s [2, 3] . The o ret i cal l y , i t   can solve any problem  whose candi da te solutions can be  m easured a nd c o m p ared,  m a king it a  widely   appl i cabl e  t e c h ni q u e. F u rt he r m ore, t h e sol u t i ons  fo u nd  by   GP a r e us ual l y  pr o v i d e d  i n  a  fo rm at  t h at  users can   u n d e rstand  and  m o d i fy to their n e ed s. Bu t  its h i gh   v e rsatili ty is also  the cau se of some d i fficu lties. Users  m u st  set  a nu m b er of  param e t e rs rel a t e d  t o  seve ral  aspe ct s o f  t h ev ol ut i ona ry  p r oce ss,  som e  of  whi c h m a influe nce the   search  proce s s  so stro n g l y as to  actu a lly p r ev en t an   o p ti m a l so lu tio n to  b e   foun d, if set  incorrectly.  And e v en whe n  a reasona b le m a tch betw een   p r ob lem  a n d par a m e ter s  is ach i ev ed a m a j o pr o b l e m  rem a ins,  o n e t h at  ha s bee n  st udi e d   fo r m o re t h a n  a  deca de:  c ode   gr owt h   [1] .   The sea r ch s p ace of  GP is  virtually unlimited a nd program s  tend to grow  i n  size  during the  evol ut i ona ry  p r oces s. C o de g r o w t h  i s  a heal t h y  resul t  of  g e n e tic o p e rato rs in  search  of better so lu tio ns, b u t  it   also  perm its the appeara n ce  of  pieces  of re dunda n t c ode  that increase  the   size of  progra m s  without im proving  t h ei r fi t n ess. m a ny  di ffe rent   b l oat  co nt r o l  m e t h o d ha ve  bee n   pr o pose d .   Thi s   pape r re v i ew, e v al uat e im pl em ent a t i o n a nd c o m p ari s on  o f  t h e s m e t hods i n   wa l l  fol l o wi n g   pr o b l e m .  The  next   sect i o n  d eal s wi t h   bl oat ,  de scri bi n g  t h e m a i n  t h eori e s  re gar d i n w h y  i t  occu rs.  Se ct i on  3   d e scri b e s th Dyn a m i c Li mi ts in  d e tail, wh ile Sect.  4 de scri bes V a ri at i ons  on si ze an d de pt h p r obl e m s and  Sect i on  rep o r t s  t h res u l t s  of t h e c o m p ari s on s am ong t h e di f f ere n t  t ech ni q u es,  w h i l e  Sect . 6  di sc uss e s t h em   and  pr esent s  s o m e  consi d e r at i ons  o n  t h usa g e o f  l i m i t   restri ct i ons i n   GP Fi nal l y , Sect . 7  concl ude s an d  Sect 8 pr o v ides  i d ea f o r f u tu re wo rk .           Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 089 -48 56  IJR A  V o l .  3, N o . 3,   Se pt em ber 20 1 4 :    20 1 – 21 1   20 2 2.   BLOAT   Whe n   Koza  p ubl i s hed t h e fi rst  b o o k   on  G P  [ 3 ] ,  m o st  of t h e ev ol ve p r o g ram s  t h erei n co nt ai ne pieces of c o de  that did not cont ribute to the sol u tion a n d could be  re m oved w ithout altering the results   pr o duce d . B e si des i m posi n a de pt h l i m it  to t h e t r ees cre a t e d by  c r os so ver t o   pre v ent  spe ndi ng  com put e r   resources  on e x trem ely large program s , Koza also   rou tin ely ed ited  th e so lu tions  provided at t h e e n d of eac ru n t o  si m p l i f y som e  exp r essi ons  w h i l e  rem ovi ng  t h re du nda nt  c ode .   Tw o y ears l a t e r,  An gel i n e  re m a rked  o n  t h ubi qui t y  o f  t h e s e re du n d ant  c ode  se gm ent s  and ,   base d o n   a slig h t  b i o l og i cal si milarity,   called  th e m  in t r on s [7 ]. In  sp ite o f  classifyin g  th em  as  ex tran eou s , u n n e cessary   and  s upe rfl uo us,  A n gel i n not e d  t h at  t h e y  pr o v i d e d  c r oss ove wi t h  s y nt act i cal l y  redu n d ant   co nst r uct i o n s   wh ere sp littin g  co u l d  b e   p e rfo rm ed  witho u t  alterin g  th se m a n tics o f  the swapp e d  su b trees. Referri n g  t o   so m e  stu d i es  wh ere th e in tro d u c tion  o f  artificial  in tro n s was h e lp fu l o r  ev en  essen tial to  th e su ccess o f   g e n e tic alg o rith m s , An g e lin e rev e ls in  th e fact th at  i n t r on s em erge nat u r a l l y  from  t h dy nam i cs of GP. He   even goes as  far as to state that ‘‘it is im porta nt th e n  t o   not  i m pede t h i s  em ergent  p r ope rt y  as i t  m a y  be  crucial to the  s u ccess f ul  de velopm ent of  genetic program s ’’ [7].  It is po ssib l e t h at in tro n s m a y p r o v i d e  so me b e nef its.  A no n-in t u itiv e effect th at in tron m a y h a v e  in  GP is co d e  co m p ression  and  parsim o n y It is no t th blo a ted  co d e   full o f  redu nd ant a seg m en t t h at is   parsi m oni o u s,   but  t h e e ffect i v e c ode  t h at   r e m a i n s aft e r e m ovi n g  t h e  i n t r ons Un de speci fi c c o n d i t i ons,  part i c ul a r l y  i n  t h pr esence   of  dest ruct i v e   cross o ver ,   t h ere is evi d e n ce t h at the  ex istence of i n tron s in  the   p opu latio n   resu lts in  shorter  an d  less co m p lex  effectiv solu tio n s   .Co m p act so lu tion s  are tho ugh t to  be  m o re   ro b u st  an ge neral i ze  bet t e r [8] .   I n t r o n s a l so d o  seem  t o   pr ovi de s o m e  pr ot ect i o n a g ai nst  t h e  de st ruct i v e   effect s o f  cr oss ove r an d ot her  genet i c  o p erat ors [ 9 8]  al t h o u g h  t h i s  m a y not  al way s  be h e l p f u l .  The  usa g e o f   ex p licitly d e fined  artificial in tron h a s yield e d  g e n e rally  g o o d   resu lts in  lin ear  GP  [10 ,   11 ], bu t in  tree  b a sed   GP i t   us ual l y  d e gra d e d  t h e  pe rf orm a nce o f  t h e sea r ch  p r oc ess [ 13] .   R e gar d l e ss  of  i t s  possi bl e be nefi t s  t o   GP , t h e si de   effects o f  in tro n  pro lifer atio n ar ver y  ser i ou s.  C o m put at i onal  reso urc e s m a y  be t o t a l l y  exha ust e d i n  t h e st ora g e, e v al uat i on a n d sw appi ng  o f  co d e  t h at   co n t ribu tes no t h ing  to  t h e fi nal so lu tion ,   p r ev en ting   GP  fr o m   perf orm i ng t h ef fec tive s earch  nee d ed to fi nd  bet t e r s o l u t i o n s . B l oat  i s  n o w  wi del y  rec o gn i zed as a  per n i c i ous  p h en om eno n  t h at  pl ag u e s m o st  pro g re ssi ve  search t ech ni q u es base d o n  d i scret e  vari abl e -l en gt h re prese n t a t i ons a nd u s i ng fi xe d eval u a t i on fu nct i o ns  [14 ,   15] . B l oat  co n t rol  ha s bec o m e  a ve ry  act i v e researc h  a r ea  in GP, alrea d y  subject t o  d i fferen t th eoretic and   anal y t i c  st udi e s  [ 10] .  Se veral  t h eo ri es c o nce r ni ng  w h y   bl o a t  occu rs  ha ve  been  ad va nce d , an d m a ny  di f f ere n bl oat   c ont rol   m e t h o d s ha ve be en pr o pose d .   Lu ke o b ser v e d  t h at  un de rl y i ng cau ses of  code bl oat i n g co nt ai ns Hi t c hhi ki ng , De f e nse agai nst  C r oss o ver,  R e m oval  B i as, Fi t n ess C a uses B l oat  an d M odi f i cat i on P o i n t   Dept h.  The n  i t  coi n e d  t h at  t h e co de  b l o a ting  i n  evo l u tion a ry com p u t atio n  field  is i d en tified with th e C - valu e Paradox   in  th e b i o l og y [1 2 ] There f ore, i f  n o  any  re st ri ct i ons a d di n g  t o   genet i c  o p e r at i ons , co de  bl oa t i ng i s  i n e v i t a bl e i n  G P . J u s t  l i k Luke said in [6], “In a ve ry real sense, bl oating  m a kes genetic programming a race against tim e to find the  best  s o l u t i o n p o ssi bl bef o re  bl oat   put s a n  e ffect i v e st o p  t o  t h e sear ch .” F o f u rt he r i n f o r m at i on o n   bl oa t  see  [1 6] .       3.   D YNA M I C  DEPTH  LIM I Dy nam i c M a xim u m  Tree De pt [ 4 ]  i s  a  bl oat  c ont r o l  t e c hni que  i n s p i r e d   by  t h e  t r a d i t i onal  st at i c   l i m i t .  It  al so i m poses a de pt h l i m i t  on t h i ndi vi dual s  acc ept e d i n t o  t h po p u l a t i on,  b u t  t h i s   one  i s  dy nam i c,  mean in g  th at it can  b e  ch an g e d  du ri n g  t h e run .  Th e d y n a m i c li mit is in it ial l y set with  a lo w v a l u e,  b u t  at  least   as h i gh  as th m a x i m u m  d e p t h   o f  th e i n itial ran d o m  tre e s. An y n e w in d i v i du al wh o b r eak s  th is limit  is   rej ecte d  and re placed  by one  of its pa re nts instead (as with th e traditional static  li mit), unless it is the best  i ndi vi dual  f o u n d  s o   far.  I n  t h i s  case, t h dy n a m i c l i m i t  i s  rai s ed t o  m a t c h t h dept of  t h e  ne best - o f - r u n a n d   allo w it in to  the p opu latio n .   Fig u re 1  sh ows  th e p s eu do  co de of this  proce d ure. T h e res u l t  is a succession of   limit risings, as  the  best s o luti on be c o m e more  accurate a n d m o re c o m p le x.  Dynam i c Maxi m u m  Tree Depth does not  necessar ily replace the  tra d itional  de pth li m i t :  bot dy nam i c and fi xed l i m i t s  can be  used at  t h e sam e   t i m e   (n ot  sh ow n i n  Fi gu re 1 ) When t h i s   hap p e n s, t h e   d y n a m i c li mit  always lies somewh ere b e t w een  th e in itial tree  d e p t h  an d th e fi x e d   d e p t h   li mit. Th e simp licit y   of  Dy nam i c M a xi m u m  Tree Dept h m a kes i t  easy  t o   use  wi t h  any  set   o f  p a ram e t e rs and/ or c o upl e d   wi t h   ot her   tech n i qu es  fo r co n t ro lling  b l oat.  The dy nam i c lim it   m a y  al so  be use d  f o r a n ot he r p u r p o s e besi des c ont ro l l i ng bl oat .  I n   real  wo rl appl i cat i o ns,  o n e m a y  not  be i n t e rest ed  or a b l e  t o  i n vest  a l a rge am ount   o f  t i m e  i n  achi e vi n g  t h best  p o ssi bl solution, partic ularly  in  approxim a tion proble m s . Instead, one m a consider a solution to be acceptable  only  if it is su fficien tly si m p le to  b e   u n d e rstoo d , ev en  if  its accu r acy is  k nown  to   b e   worse  than t h e acc uracy of  o t h e r m o re com p lex  so lu tio ns. Plu s , sh orter so lu tion s  ten d   to  g e n e ralize  better (Sect.  2 ) On way to  avo i d  t h Evaluation Warning : The document was created with Spire.PDF for Python.
I J RA I S SN 208 9-4 8 5 6     C ont r o l i n g  Bl o a t  i n   Ge net i c  P r og ra m m i n g F o Sl ovi n g  Wal l  Fol l o w i n g  P r obl e m  ( N avi d   Bazrk ar)   20 3 o v e r-sp ecializatio n  of th e so l u tio ns fo und  by GP is to  cho o s e term in ati o n  criteria th at will n o t  fo rce th ev o l u tio n a ry  pro cess to   go   on  ind e fi n itely in  search   o f  a p e rfect so lu tio n.  A less stri n g e n t  stop  cond itio n   yields a s o m e what i n acc ura t e solutio n ,  bu t on e th at is also   sim p ler  and   ho p e fu ll y g e n e ralizes  b e tter.  Howev e r, settin g th e ri g h t   sto p  co nd itio may b e  a m a j o r ch alleng e in  itself, as  one canno t pred ict th com p lexity needed to achie ve a ce rtain le ve l of acc uracy By startin g th e search   with a l o w d y n a m i c li mit fo r   tree de pth, the   search is force d  to conce n trat e on sim p le  solu tio n s  first. Th e lim i t  is th en   raised   wh en  a n e w   solution is  found t h at is m o re com p lex, but also m o re accurate, t h a n  the pre v ious  one. As t h e e vol ution  procee ds, the l i m i t is repeatedly raised as  m o re a n d  m o re co m p lex  so lu tio ns ach iev e  in creasing l y h i gh er  levels of accuracy. Regardless of the st op c o ndition,  the  Dynam i c Maxi m u m  Tree Depth tec hni que  can i n   fact  pr ovi de a seri es of s o l u t i ons  of i n creasi ng c o m p l e xi t y  and acc uracy ,  from  whi c h t h e use r s m a cho o se   the one m o st a d equate to thei needs .           Fi gu re  1.  Pse u do  co de  o f  t h e   basi Dy nam i c M a xi m u m  Tree De pt p r oce d ure  ( w i t h   no  st at i c  l i m i t )       4.   VA RI ATIO N S  O N  SIZ E  A N D  DEPT H   The origi n al Dynamic Maxim u m Tree De pth  was s o on   ex tend ed  t o  inclu d e  ad d itional v a rian ts: a   heavy  dynam i c lim i t, called heavy  b eca use  it falls back t o  lower  values  whe n e v er all o wed, and a  dy namic   limit on size instead  of  de pth. Fi gure 2 s h ows t h e ge neral acceptance  proce d ure (inc luding all the varia n ts,  u s ing  no  static li mit) th at a ll n e wly created  in d i v i du als  m u st p a ss b e fore b e ing  accep ted  in to  th e n e w   gene rat i o n. T h i s  i s  an e x t e nsi o n o f  t h e  p r oce d ure i n  Fi gure 1. Only the s h aded pa rt s are com p le tely n e w.  Bo th   th e n e w cod e   an d  t h e sm all   d i fferen ces in   th e co mm o n  co d e   will b e  exp l ain e d  i n  th n e x t  section s An y   indivi dual that does  not m eet the si ze/dept h/fitness re qui re m e nts of the  Dynam i c Lim its   m e thod  will not be  accepted by t h is proce d ure ,   but instead  replac ed by  one of  its  pa rents .     Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 089 -48 56  IJR A  V o l .  3, N o . 3,   Se pt em ber 20 1 4 :    20 1 – 21 1   20 4     Figure  2. Pse u do code  of the   gene ral  Dynamic Lim its acceptance procedure  (all va riants,  no static lim i t).       Th is is an  ex ten s ion   o f  th pro cedure in Figu re  1.  On ly th e sh ad ed  co d e  is co m p letely n e     5.    HEAV Y DYN AM IC  LIM I Dy nam i c M a xim u m  Tree D e pt h i s  ca pa bl e of  wi t h st a n d i ng a c o nsi d e r abl e  am ount  o f  pa rsi m ony   p r essure, as  p r o v e n   b y  th e resu lts ob tain ed   b y  in itializin g  th e d y n a m i c li mit with  th e lo west po ssib l v a lue,  t h e m a xim u m   dept h o f  t h e i n i t i a l  rand om  t r ees [4]  ( S ect 3. 1. 2) . S o  t h er e s e em s t o  be n o   reaso n   why  t h e  l i m i sh ou l d  no t b e  allo wed  t o  fall back  to  lower  valu es in  case the d e p t h  of th n e b e st ind i v i d u a b eco m e s l o wer  th an  t h e cu rrent li mit, an  o c cu rren ce wh ich  is actu a lly  ver y  com m on. So  t h e fi rst  va ri at i on i n t r od uce d  t o  t h e   ori g inal Dyna mic  Maxim u m Tree Dept h is the Heavy dy nam i c  limit, one that acco mpanies the de pt h of the   b e st in d i v i du al, u p   o r   d o wn with  th e so le co n s t r ain t  of not g o i ng  lo wer th an  its in itializ atio n  v a l u e [5 ] .  An  ad d ition a l v a ri atio n  is th e VeryHeav y li mit,  si m i lar to  th h eav y v a rian b u t  allo wed  to   fall b ack  ev en   b e low  its in itializat io n   v a lu e. Bo t h  t h ese  v a rian ts are c o v e red in  t h e secon d  sh aded   b l o c k   o f  Figu re 2.  As exp ected, wh en ev er th li mit falls b a c k  to   a l o we r val u e, s o m e  indi viduals already in the   po p u l a t i on i m m e di at el y  break t h new l i m it , becom i ng ‘i l l egals’. T h ere  was a va st range of options t o  deal   with  th em , th m o re drastic  b e ing  th eir im med i ate re m o val fro m  th e pop u l ation ,   po ssi b l y rep l acing  t h em  b y   n e w   ran d o m  in d i v i du als.  How e v e r, si n ce these n e w  ‘ illeg a ls’ cou l d   b e  the o n e s who  m a n a g e d  to produce th new  best  i n di v i dual ,  el i m i n ati ng t h em  coul d be  ha rm ful  for t h e searc h   pr ocess .  A m u ch s o ft er  o p t i o n wa s   ad op ted :  th ‘illeg a ls’ are allowed  to   rem a in   in  th e po pu la tio n  as if th ey  were no t b r eak i ng  th e li m it, b u t  wh en  bree ding, t h eir childre n ca nnot be  dee p er t h an t h d eepe s t pare nt. T h is  naturally and gra d ually places the   p opu latio n  wit h in  limits ag ai n .  Th e first shad ed   b l o c k  of Fig u re 2   d eals with  cho o s i n g th e rig h t  limit  (my  li mit i) to  u s e for th n e w i n d i v i du al,  d e pen d i n g  on   wheth e r it h a s illeg a l p a ren t s.  Th first co m p ariso n   i n v o l v i n g t h vari a b l e  dy na m i c l i m i t  i n  Fi gu re  1 (i f si ze _i  <= dy nam i c_l i m i t )  i s  no w  per f o rm ed usi n g  t h v a riab le m y _ l i m it_ i in  Figu re 2   ( if size_ i <= my_ l i m i t _ i  )      6.   DY N A MI C SI Z E   LIMIT  Eve n  t h o u g h  bl oat  i s  kn o w n t o  a ffect   m a ny  ot her  search  pr oce sses usi n va ri abl e  l e n g t h   rep r ese n t a t i ons  (Sect 2) dept h l i m i t s  cannot  be  use d  o n   n o n  t r ee -base d   G P  sy st em s. Ext e ndi ng  t h e i d e a  of  a  dy nam i l i m i t o  ot he r dom ai ns m u st  begi n wi t h  t h e rem oval  of t h e co n cept  of de pt h, repl aci n g  i t  wi t h  t h e   conce p t   of  si ze. The  sec o n d  vari at i o on   t h e o r i g i n al  D y nam i c M a xi m u m  Tree Dept h i s  t h usa g of a   dy nam i c si ze lim it , where si ze i s  t h e num ber o f  n ode s [ 5 ] .  If a st at i c   l i m i t   i s  t o  be  use d  al on g wi t h  t h is  dy nam i c l i m i t ,  i t  sho u l d   al so  be  on  si ze,  no t  dept h. T h v a ri abl e   dep t h _ i  of t h pseu d o  c ode i n  Fi gu re 1  i s   n o w called  siz e _i  in   Figu r e  2, alth ou gh  it can   refe r to  eithe r  size  or  de pth .   Tree in itializat io n  in  tree-b a sed  GP also  typ i cally relies o n  th e con cep o f  d e p t h. Th is is th e case  with the popul a r Grow, Full, and  Ram p ed Half-a nd-Half  initialization  m e thods [3]. Both Grow and Full  m e thods  creat e trees  by adding  ra ndom  node until a m a xim u m  specified de pth. T h e  Grow m e thod adds   Evaluation Warning : The document was created with Spire.PDF for Python.
I J RA I S SN 208 9-4 8 5 6     C ont r o l i n g  Bl o a t  i n   Ge net i c  P r og ra m m i n g F o Sl ovi n g  Wal l  Fol l o w i n g  P r obl e m  ( N avi d   Bazrk ar)   20 5 i n t e rnal   or t e r m i n al  nodes ,  e x cept  at  t h e m a xi m u m  dept h,  whe r e t h e c h oi ce i s  rest ri ct ed t o  t e rm i n als. Thi s   creates trees  with differe n t s h apes  a n d sizes. The  Full m e thod creates  bala n ced trees, wit h  all term in al n o d e at  t h m a xim u m  dept h. It  d o e s t h i s  by  addi ng ra n dom  i n ternal  n o d e s ex cept  at  t h m a xi m u m  dept h,  whe r e i t   selects only term inals. The Ra m p ed Half-and-Half m e th o d  is a co m b in atio n   of  th e two ,  wh ere h a lf  th p opu latio n  is i n itialized  with Grow, and  the o t h e h a lf  w ith  Fu ll.  In each   h a lf tr ees are created   with   d e p t h   li mits ran g i ng   fro m  2  to  a  sp ecified  m a x i m u m  v a lu e, en su ri n g  a  v e ry  d i v e rse in itial p opu latio n .   Whe n   usi n g t h e dy nam i c si ze l i m i t ,  i t   m a kes no  sense t o   keep  usi ng  de pt h as a  rest ri c t i on o n  t r ee   in itializat io n .   So  a m o d i fied v e rsi o n   o f  t h e Ra m p ed  Hal f-an d -Half in itializatio n   m e t h od   was creat ed  [5 ],  wh ere an  equ a l  n u m b e r o f  indiv i d u a ls are in i tialized  with  si zes rang ing  b e t w een   2  and  th e in itial  v a lu e of th d y n a m i c size li mit. Fo r each  size, h a lf or th e in d i v i du als are in itialized  wi th  th Grow m e th od , and  th o t h e hal f  wi t h  t h e F u l l   m e t hod, t h a t  have al so bee n  m odi fi ed t o  f i t  t h e si ze const r ai nt s onl y .  I n  t h m odi fi ed  Gr o w   m e thod, the i ndi vidual grows by ad dition of ra ndom   nodes (i nterna l or  term inal) withou t excee ding the  m a xim u m  specified size; the  m odified  F u ll  m e thod choos e s only interna l   node s until the size is close to the  sp ecified, and   o n l y th en  choo ses term in als. Un lik e th o r ig in al Fu ll m e th od , it  m a y n o t b e  ab le to   create  i ndi vi dual s   wi t h  t h e e x act  si z e  speci fi e d bu t  onl y  cl ose  (a nd  ne ver e x ce edi n g) . Fi g u r e   3 s h o w s t h e  p s eu do   co d e  of   bo th  m e th od s.          Fig u re  3 .  Pseud o  cod e   of th m o d i fied  Grow and  Fu ll in itializatio n  m e th o d     7.   WALL FOLLOWING PROBLEM  M a t a ri c [1 7]  d e scri be d t h e  p r obl em  of c o nt r o l l i ng a n  a u t o n o m ous m obi l e  ro b o t  t o   per f o r m   t h e t a sk   o f   fo ll o w i n g  t h e walls  o f  an irregu lar  ro om . Th e rob o t  i s  cap ab le of ex ecu ting  t h e fo llo wi n g  fiv e   p r im it iv e   m o t o r funct i o n s :   m ovi ng f o r w ar d by  a con s t a nt  di st ance,  m ovi ng bac k w a rd by  a con s t a nt  di st ance, t u r n i n g   r i gh t b y   30   d e gr ees, t u rn ing  lef t  b y   30   d e gr ees, an d stop p i ng. Th r obo t h a s 12  son a r senso r s wh ich r e por t th di st ance t o  t h e  nea r est  w a l l .   Each s o nar  se n s or  co ve rs a  3 0   deg r ee s ect or  ar ou n d  t h e  r o bot .  I n  a d di t i on, t h ere   was a sens or  f o r t h e S T OP P E D co n d i t i on  of t h ro b o t .  F i gu re 4 s h o w an i rre gul a r l y  sha p ed r o om  and t h di st ances  rep o r t e d by  t h e  1 2  s ona r se ns ors .   The  ro b o t  i s  sh ow n at   poi nt  ( 1 2 ,   16 near t h e cent e o f  t h ro om The  n o rth  (t op )  wall an west  (left)   wall are  e ach  27.6 feet l o ng.          Fi gu re  4.  I rre g u l a ro om  wi t h  r o b o t   wi t h   12   son a r s e ns o r s l o cat ed  nea r  m i ddl o f  t h e  r o o m     Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 089 -48 56  IJR A  V o l .  3, N o . 3,   Se pt em ber 20 1 4 :    20 1 – 21 1   20 6 8.   EX P E R I M E NT S   Al l  t h e e x peri m e nt s we re  pe rf orm e d o n  t r e e -base d  GP   us i ng m y  java  c ode  [ ? ? ]   Wal l  f o l l o wi ng  p r ob lem  was ch o s en to  test, an d th is is a first research   o f  b l o a t pro b l em  in  wall fo llo wi n g   8. 1.   Process  of W o rk:  Th p r ob lem  is  so l v ed u s i n g a GP.  Gene:  Sche me program  that is represe n te by a T r ee  (Li k e a c o m p iler AST ) (a)  Term inals: {SS0 …SS 1 1,  EDG ,  S S , M S D}   EDG  ==  2. 3,  S S  ==m i n im u m   of  al l  sens or s,  M S D ==  2. 0.   SS0 ..S S1 1 a r t h e sens o r s i n   a 30  de gree i n t e rval , a n d eac ret u rn s th distan ce to  th first in tersected wall.     (b) F u nctions:  {PLUS ,   IFLT E, PR OGN2, T L , TR, MB, M F All th e fun c tion s  are tak e n   fro m  th e article, ex cep t  PL US  th at tak e 2  arg u m en ts and   retu rn  th eir sum .  TL,   TR, MB, MF – m oves the robot and ret u rns the m i nim u m  of SS 2 and  SS3. IF LTE -  equals t o  "if less the n   equal  t h en el s e ". PR O G N 2   t a kes 2 a r gum ent s  eval uat e s  bot of t h em  and  ret u r n s t h e sec o n d Al l  t h fun c tion s  th at   mak e  th robo t m o v e  tak e   on e ti m e  step   Fitn ess fun c tion :   Th e fitn ess functio n  is th n u m b er o f  tiles (o u t   o f   56 ) th at  th e ro bo t m o v e s th ro ugh  th em. Each   robo t   h a s 400  ti m e  s t ep s to  si m u lat e , an d  if th ere is n o  ch ang e  fro m   th e last ev alu a tio n  we  will sto p  th e ev alu a tion  l o o p . Sel ect i o n   m e t hod:  Fi t n ess pr op ort i on f unct i o n,  usi n g ro ul et t e  wheel  sam p l i ng. Pop u l a t i on si ze = 50 0 .   Num  of  ge nera t i ons =  5 1 .  C r o sso ver:  P c  =  0. 9.   The cr oss  o v er  i s  do ne bet w e e n su b t r ees , t h e sub t r ee i s  pi cked  ra nd om l y . M u t a t i on:  Pm  = 0. 01 . I n  o u r  case  the m u tation obj ective is to reduce t r ee size . It will pi c k  a  sub tree a nd  replace it with a ne w sub tre e  of    dept h 1.     Steps /  Process :   1 .          In itial pop u l ation  calcu lated  rand o m ly,  all th e trees are co m p lete in  dep t h   of  2 .   2. 1     Fi t n e ss c a l c ul at i on.   2. 2    ap pl y  dy n a m i c dept h  m e t h o d   [1]   2. 3    ap pl y  hea v y  m e t hod  (si ze/ dept h )   [1]   2. 4    ap pl y  fal l s bac k  m e t hod   (l o w er  val u e s [1]   3.        Selection.  4.        C r oss o ve r a n d  m u t a t i on.  5.        M o vi ng  t o   next   ge nerat i on .   On o f  t h e pro b l em s in  GP is th at th e Tree –  Cod e  h a v e  th e tend en cy to  g r o w  t h ro ugh ou t th gene rations.  We tried to m o derate the probl e m  usi ng tree  m e thod a nd m u tation  fu nction (with proba bility of   Pm =0.01 ) we  repl ace d a  ra n dom  su b t r ee   wi t h  a  ne w t r e e  o f  si ze  1.  T h i s  s h o u l d  ca u s e t h e t r ee  – c ode  t o   reduce its size. The  Fitness  function do es n' t  take i n t o  acc ou nt  t h e l e ngt of  t h pat h an n u m b er o f  t i m st eps   neede d  to com p lete "collecting" all  the tiles.  So we tried to  replace the  Fitness functi on  with a new Function.  F1  =  (Tiles step p e d   o n ) +  facto r  /(Tim e  step s) +  f actor /(W a ll  co llision s ). Wh ere  Tiles  step p e d  on  -  th e   n u m b e r  of  Tiles th at th e r obot "p ick e d "   d u r i n g  t h e ru n. Time step s –  th e n u m b e r  of  time step s th at t o ok  th robo t to  co m p l e te th missio n  ( m ax  4 0 0 )  .Wall co llisio n s  –  th e n u m b e r of walls th at th e ro bo t co llid ed   du ri n g   t h e r u n. T h ne w fi t n ess  fu nct i on  ha no  ef fe ct  on  t h e e v ol u t i on  pr o g ressi o n , s o   we  deci d e d t o  d r op  t h e i d ea.   You ca n also s ee the des p ite the fact that the robot  di dn 't t a k e  th e ab ov d a ta it f o und  a v e r y  shor t w a y t o   solve the  proble m .  You ca n see clear ly the increa sing value  of the a v era g e and be st fitness duri ng the   gene rat i o ns.  It  con f i r m s  t h e cor r ect ness  o f  u s i ng  GP t o  sol v e t h i s   pr obl e m . In t h e si m u lat e d pl ot   of  ge nerat i o n   3 0 , 40 , 51  you can  see an  in ter e stin g   b e h a vio r  at th e b e g i n n i n g   o f  th e rob o t  p a t h , it d o es so m e  u n e x p lain ed  lo op s.  W e  witnessed  t h e sam e  b e h a v i o r  in   Ko za's article.      9.   RESULTS  Th is sectio n   p r esen ts th e results o f  all th e ex p e rim e n t s. Sev e ral p l o t s and th eir b r ief and Best Tree   Dept h f o r bl ot  descri pt i o n s  ar e prese n t e d. Fi gu re 5 s h o w a bo xpl ot  of t h e best  fi t n ess o f  ru n an d sh o w s t h evol ut i o n  o f  t h e best   fi t n ess a l on g t h e  r u n.  An d C o m p are  cano n i cal  G P   wi t h   new  m e t h od  i n  st a n dar d  ro om   and ne room  are  prese n ted.  A. out put  i n  c a no ni cal  G P  i n  st an dar d   ro om   B e st  i ndi vi du al :  49   B e st  Tree  Dept h:  5   Evaluation Warning : The document was created with Spire.PDF for Python.
I J RA I S SN 208 9-4 8 5 6     C ont r o l i n g  Bl o a t  i n   Ge net i c  P r og ra m m i n g F o Sl ovi n g  Wal l  Fol l o w i n g  P r obl e m  ( N avi d   Bazrk ar)   20 7 (IF LTE (PR O GN2 (IFLTE  S06 (PROGN2  (PR O GN2  M F   S 1 1) (PR O GN2 S11  M F ))  (PROGN2 MB  S10 )   (PRO G N 2  S 0 4  S0 9) ) M F (P ROG N 2  ( I FLT E  ED TL TR  M B ) M S D) M F  TR)           Fi gu re  5. 1.    Ou t put  i n  can o n i c al  GP           Fi gu re 5. 2.   O u t put  i n  ca no ni ca l       A. out put   wi t h   new  m e t hods  i n  st a nda rd  r o om     B e st  i ndi vi du al :  50   B e st  Tree  Dept h:  3   (IF LTE  (IFLT E  MF MF  MF  S00) (IFLTE  S 0 8 MB S 0 5 T R ) (IFLT E  TL   MF MF MF (PROGN2  (IF L TE TR    S1 0 S 0 2 M F M F ))           Fi gu re 6. 1.    Ou t put  wi t h  new  m e t hod     Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 089 -48 56  IJR A  V o l .  3, N o . 3,   Se pt em ber 20 1 4 :    20 1 – 21 1   20 8     Fi gu re 6. 2.   O u t put  wi t h  ne w m e t hod       B 1 o u t p ut  i n  c a no ni cal  G P  i n  ne ro om 1   B e st  i ndi vi du al :  54   B e st  Tree  Dept h:    6   (IF LTE (IFL T E  S00 MF (PROGN2 (P LUS (PROGN2  S01 (IFL TE MF  MF MF MF))  (PROGN2  (PR O GN2  TR MB)  MB))   S02 )  M F )   S08   MF MF)          Fi gu re  7. 1.  O u t put  i n  ca no ni ca l  GP           Fi gu re  7. 2.  O u t put  i n  ca no ni ca l  GP                   Evaluation Warning : The document was created with Spire.PDF for Python.
I J RA I S SN 208 9-4 8 5 6     C ont r o l i n g  Bl o a t  i n   Ge net i c  P r og ra m m i n g F o Sl ovi n g  Wal l  Fol l o w i n g  P r obl e m  ( N avi d   Bazrk ar)   20 9 B 2 . o u t p ut   wi t h  new   m e t hod   i n  new   r o om B e st  i ndi vi du al :  54   B e st  Tree  Dept h:    4   (IF LTE (IFLT E  MB (IFLTE  S00 MB MB MB) (IFLTE  MB EDG MB MB) MB) ( I FLTE MB MB MB  (IF LTE TL MB MB  MB)) (IFLTE MF S10 TR (IFLTE  E DG MB MB  MB)) (IFLTE  MF TR (IFLT E S00  M B  (IFL TE M S S0 9 M F  T R ) M B ) TR           Fi gu re 8. 1.   O u t put  wi t h  ne w m e t hod           Fi gu re 8. 2.   O u t put  wi t h  ne w m e t hod       C 1 o u t p ut  i n  c a no ni cal  G P  i n  ne ro om 2     B e st  i ndi vi du al :  33   B e st  Tree  Dept h:    6   (PROGN2  (IF LTE S09 (IFL TE (IF LTE M F  (IF LTE S 09  MF (IFL TE T R  SS MB MB  ) MF) (IFLT E  TR SS  M B  M B ) (PR O G N 2  S S  S 0 7 0 ) )  M F   (I FLT E  (I FLTE  S 0 MF ( I FLTE TR SS MB MB) MF)  MF (I FLTE TR    SS MB MB) (IFLTE S 09 MF  (IFL TE TR S S   MB MB) MF)) MF ) (IFLT E  (IF LTE (IFL TE S09 MF (IFLTE   TR SS MB MB) (PROGN2  S05 S03) ) MF  (IFLT E TR SS MB MB) MF) (IFLTE S 0 9 MF (IF LTE  TR SS   MB MB) MF) (IFLT E S09 (IFLTE S 0 9 MF (IFL TE TR  SS MB MB)  S09) (IFL TE TR SS MB MB) MF)  (IF LTE (IFLT E  (IFLT E S09 MF (IFLTE  TR SS MB MB ) (PROGN2  S05 S03))  MF (IFLTE TR S S  MB  MB) MF) (IFL TE S09 MF  (IFLTE TR S S   MB MB)  MF) (IF LTE S 0 9 (IFLTE  S09 M F  (IFLTE TR  SS MB  MB) S09) (IF LTE TR SS   MB MB) MF) MF))  (PROGN2  (IF LTE  S09 MF  (IF L TE TR SS M B  MB)   (PROGN2 SS  S070)) MF )) (IFLTE (IFLTE  (IF LTE S09 MF  (IFL TE TR SS MB MB) (PROGN2 S05  S03))   MF (IFLTE T R  SS MB MB) MF)  (IFLTE  S09 MF (IF L T E  TR SS MB  MB) (IFLTE  S09 (IFLT E  S 09 M F   (IF LTE TR  SS  MB MB) (PROGN2 S S  S 070))  (IF LTE TR  SS MB MB)  MF)) M F  MF ))    Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 089 -48 56  IJR A  V o l .  3, N o . 3,   Se pt em ber 20 1 4 :    20 1 – 21 1   21 0     Fi gu re  9. 1.  O u t put  i n  ca no ni ca l  GP           Fi gu re  9. 2.  O u t put  i n  ca no ni ca l  GP       C 2 o u t p ut  wi t h   new  m e t hod   i n   new  r o om 2    B e st  i ndi vi du al :  30   B e st  Tree  Dept h:    2   (IF LTE  (IFLT E  MF S 0 9 S 06 MF) MF  (PL U S MB TR ) S 0 2)          Fi gu re  1 0 . 1 O u t p ut  wi t h  ne w  m e t hod       Evaluation Warning : The document was created with Spire.PDF for Python.