📄 277-280.html
字号:
<HTML>
<HEAD>
<META name=vsisbn content="0849398010">
<META name=vstitle content="Industrial Applications of Genetic Algorithms">
<META name=vsauthor content="Charles Karr; L. Michael Freeman">
<META name=vsimprint content="CRC Press">
<META name=vspublisher content="CRC Press LLC">
<META name=vspubdate content="12/01/98">
<META name=vscategory content="Web and Software Development: Artificial Intelligence: Other">
<TITLE>Industrial Applications of Genetic Algorithms:Development of Mobile Robot Wall-following Algorithms Using Genetic Programming</TITLE>
<!-- HEADER -->
<STYLE type="text/css">
<!--
A:hover {
color : Red;
}
-->
</STYLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<!--ISBN=0849398010//-->
<!--TITLE=Industrial Applications of Genetic Algorithms//-->
<!--AUTHOR=Charles Karr//-->
<!--AUTHOR=L. Michael Freeman//-->
<!--PUBLISHER=CRC Press LLC//-->
<!--IMPRINT=CRC Press//-->
<!--CHAPTER=14//-->
<!--PAGES=277-280//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="276-277.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="281-284.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>RESULTS</B></FONT></P>
<P>The genetic programming engine was, indeed, able to organize the functions and terminals described above into fairly proficient wall-following algorithms. This section describes a typical evolutionary cycle. The initial generations of each run, as expected, performed quite poorly. The robot paths in Figure 14.6 (shown as dotted lines) are typical of early generations. The robot manages to maneuver into the wall-following corridor and claim a few grid points, but has not yet figured out how to turn and follow the corridor. (The target corridor shading has been removed for clarity.)
</P>
<P><A NAME="Fig7"></A><A HREF="javascript:displayWindow('images/14-07.jpg',400,409)"><IMG SRC="images/14-07t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/14-07.jpg',400,409)"><FONT COLOR="#000077"><B>Figure 14.6</B></FONT></A> Typical result of early generations in a GP run.</P>
<P>The GP-generated code that produced the behavior displayed in Figure 14.6 is shown below. The line numbers are for reference only, and the indentation represents the calling hierarchy. This particular solution capitalizes on the hysteresis band in the WhileTooFarFromWall function to skim the edge of a wall following corridor in the upper right room.
</P>
<P>It begins with a WhileTooFarFromWall loop, with a Do2 function as the body. The robot starts in a too-far-from-wall position, so the Do2 is evaluated. The first argument of the Do2 is a TurnAwayFromClosestWall terminal which sets the direction of the robot to the left in all cases. The second argument of the Do2 is another WhileTooFarFromWall loop with a MoveForward terminal as its body. This loop repeats until the too-far-from-wall test fails (i.e., the robot ends up within allowable wall-following range). The inner WhileTooFarFromWall loop terminates at that point. The Do2 is complete, so the outer WhileTooFarFromWall loop evaluates the position of the robot. Finding that the robot is not too-far-from-wall, this loop terminates and the program ends with a total of 13 hits out of the possible 933.</P>
<DL>
<CENTER>
<TABLE WIDTH="90%">
<TR>
<TD>0
<TD COLSPAN="4">WhileTooFarFromWall
<TR>
<TD>1
<TD>
<TD>Do2
<TR>
<TD>2
<TD>
<TD>
<TD COLSPAN="2">TurnAwayFromClosestWall
<TR>
<TD>3
<TD>
<TD>
<TD COLSPAN="2">WhileTooFarFromWall
<TR>
<TD WIDTH="4%">4
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD WIDTH="82%">MoveForward
<TR>
<TD>END
</TABLE>
</CENTER>
</DL>
<P>GP soon begins to develop solutions that exhibit rudimentary wall-following behavior, as shown in Figure 14.7. These solutions typically perform reasonably well in the square room, and claim a few corridor grids in the more complex rooms by ricocheting around the environment.
</P>
<P>The code for the individual displayed in Figure 14.7 is shown below. It begins with a WhileTooFarFromWall loop with a Do2 as its body. The arguments of the Do2 are a MoveForward and a Do2 with two WhileInCoridorRange loops as arguments. While the robot is out of corridor range the WhileInCoridorRange tests will fail. The result is that the robot will move forward until it finds itself within corridor range of a wall. When the MoveForward on line 2 moves the robot into a wall-following corridor, the WhileInCoridorRange functions are able to execute. The first (on line 4) turns the robot away from the closest wall repeatedly until the maximum loop counter is exceeded.<SUP><SMALL><B>4</B></SMALL></SUP> The second (on line 6) employs a Do2 to turn the robot parallel to the closest wall and move forward. These two steps are repeated until the robot moves out of range, or the loop times out.<SUP><SMALL><B>5</B></SMALL></SUP> When either of those conditions occurs, another iteration of WhileTooFarFromWall (on line 0) is made. If the robot is out of range and the loop counter is not maximized, the process repeats. This algorithm passes through a total of 275 corridor grids.</P>
<BLOCKQUOTE>
<HR>
<SUP><SMALL><B>4</B></SMALL></SUP><FONT SIZE="-1">Actually these loops terminate immediately if the robot does not move during the course of evaluating the function body. This feature was added to improve the performance of the simulator.
</FONT>
<BR><SUP><SMALL><B>5</B></SMALL></SUP><FONT SIZE="-1">The instruction pair, TurnParallelToClosestWall and MoveForward, are capable of navigating a concave turn because the robot gets closer to the wall it is approaching than the wall it is following before it goes out of corridor range. The instruction pair is not capable, however, of negotiating a convex corner - the robot simply moves out of range. This is the reason the robot follows the walls briefly and then loses them.
</FONT>
<HR>
</BLOCKQUOTE>
<DL>
<CENTER>
<TABLE WIDTH="90%">
<TR>
<TD WIDTH="4%">0
<TD COLSPAN="6">WhileTooFarFromWall
<TR>
<TD>1
<TD>
<TD COLSPAN="2">Do2
<TR>
<TD>2
<TD>
<TD>
<TD COLSPAN="4">MoveForward
<TR>
<TD>3
<TD>
<TD>
<TD COLSPAN="2">Do2
<TR>
<TD>4
<TD>
<TD>
<TD>
<TD COLSPAN="3">WhileInCoridorRange
<TR>
<TD>5
<TD>
<TD>
<TD>
<TD>
<TD COLSPAN="2">TurnAwayFromClosestWall
<TR>
<TD>6
<TD>
<TD>
<TD>
<TD COLSPAN="3">WhileInCoridorRange
<TR>
<TD>7
<TD>
<TD>
<TD>
<TD>
<TD COLSPAN="2">Do2
<TR>
<TD>8
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD WIDTH="4%">
<TD>TurnParallelToClosestWall
<TR>
<TD>9
<TD>
<TD>
<TD>
<TD>
<TD>
<TD>MoveForward
<TR>
<TD>END
</TABLE>
</CENTER>
</DL>
<P><A NAME="Fig8"></A><A HREF="javascript:displayWindow('images/14-08.jpg',430,440)"><IMG SRC="images/14-08t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/14-08.jpg',430,440)"><FONT COLOR="#000077"><B>Figure 14.7</B></FONT></A> Typical result of a GP run as it begins to learn the wall-following behavior.<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="276-277.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="281-284.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Copyright © <a href="/reference/crc00001.html">CRC Press LLC</a></font>
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->
</BODY>
</HTML>
<!-- END FOOTER -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -