📄 gpe.htm
字号:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Genetic Programming FAQ</title>
</head>
<body>
<div id="nsbanner">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<div id="bannerrow1">
<table class="bannerparthead" cellSpacing="0">
<tr id="hdr">
<td class="runninghead" style="font-size: 70%">
<font face="Arial"><a class="show" id="design_toggle" title="Show or hide design notes" href="../index.html"><img src="../Images/Icons/G.png" width="14" height="14" border="0" align="middle"/></a> Genetic Programming Engine FAQ</font></td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1" style="font-size: 85%; left: 5px; position: relative">
<font face="Arial">Overview of the Genetic Programming Engine</font></h1>
</div>
</td>
<td vAlign="top" align="right">
<font face="Arial">
<img src="../Images/Icons/GP_blue.png" width="191" height="39"></font></td>
</tr>
</table>
</div>
<div id="nstext">
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Arial">The GPEngine
class is the central class </span><span style="font-family:Arial">for </span>
<span style="font-family: Arial">genetic programming</span><span lang="EN-GB" style="font-family:Arial">.
It drives the genetic algorithm that provides solutions to the user defined
problem. It is responsible for initializing the </span>
<span style="font-family:Arial; font-weight:700">Population</span><span lang="EN-GB" style="font-family:Arial">
by using the defined </span><span style="font-family:Arial"><b>IIndividual</b> </span><span lang="EN-GB" style="font-family:Arial">
and </span><span style="font-family:Arial"><b>IEnvironment</b> classes</span><span lang="EN-GB" style="font-family:Arial">.
It creates a </span><span style="font-family:Arial">Population</span><span lang="EN-GB" style="font-family:Arial">,
tests it, and then mutates the </span><span style="font-family:Arial">
IIndividuals</span><span lang="EN-GB" style="font-family:Arial"> to form the
next generation.</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Arial">The
</span><span style="font-family:Arial">O</span><span lang="EN-GB" style="font-family:Arial">ptions</span><span lang="EN-GB" style="font-family:Arial"> method gets and sets the various </span>
<b><span style="font-family:Arial">EngineO</span></b><span lang="EN-GB" style="font-family:Arial"><b>ptions</b>
used to control the engine during this run. It verifies that the
options are not null and then sets the </span>
<span style="font-family:Arial">EngineOptions</span><span lang="EN-GB" style="font-family:Arial">.
Options include the population size, generation size, whether to maximize or
minimize fitness, and more. </span><span style="font-family:Arial">
Further explanations can be found in the EngineOptions class.</span></p>
<div align="center">
<table border="0" width="90%" id="table1">
<tr>
<td>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">public
EngineOptions Options {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<font size="2"><span style="font-family: Courier New">
</span></font>
<span style="font-size: 10.0pt; font-family: Courier New">get {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
return m_Options;</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New"> }</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
set {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
if( value == null ) {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
throw new ArgumentNullException( "value", "The value
passed to</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
GPEngine.Options_set was null." );</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
}</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
m_Options = value;</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New"> }</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">}</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
private EngineOptions m_Options = new EngineOptions();</span></td>
</tr>
</table>
</div>
<p class="MsoNormal"><font face="Arial"><span lang="EN-GB">The
</span>ProblemSpaceClasses method <span lang="EN-GB">gets and sets the problem space classes specified by the user to
use in the
</span>GPEngine<span lang="EN-GB">. If no problem space classes are defined, the first one
found will be used. This method also initializes the generation number to
0. Problem space classes can not be changed whilst the
</span>GPEngine<span lang="EN-GB"> is running.
</span></font><span lang="EN-GB"> </span></p>
<div align="center">
<table border="0" width="90%" id="table2">
<tr>
<td>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">public
CompatibilityVerifier ProblemSpaceClasses {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
get {</span></p>
<p class="MsoNormal" style="text-autospace: none; margin-top: 0; margin-bottom: 0">
<span style="font-size: 10.0pt; font-family: Courier New">
//if no problem has been set, find one</span></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -