📄 precode.htm
字号:
<tr>
<td width="100%"><font SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">private</font><font SIZE="2"><font face="Courier New">
IPrecodeTree Instance {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">get</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">return</font><font SIZE="2"><font face="Courier New">
m_Instance;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">set</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
m_Instance = </font></font><font SIZE="2" face="Courier New">value</font><font SIZE="2"><font face="Courier New">;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">}</font></p>
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">private IPrecodeTree m_Instance;</font></td>
</tr>
</table>
</center>
</div>
<p class="dtH4"><font face="Arial">The MaxTreeDepth method gets and sets the
maximum tree depth, as specified by the <b>EngineOptions</b>, to be used in <i>
GenerateRandomTree</i> below.</font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber4">
<tr>
<td width="100%"><font SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">public int</font><font SIZE="2"><font face="Courier New">
MaxTreeDepth {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">get</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">return</font><font SIZE="2"><font face="Courier New">
m_MaxTreeDepth;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">set</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">if( value</font><font SIZE="2"><font face="Courier New">
<= 0 ) {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">throw new
ArgumentOutOfRangeException( "value", value, "The value passed to</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Courier New" SIZE="2">
</font><font SIZE="2"><font face="Courier New">
PrecodeVerifier.MaxTreeDepth was less than or equal to zero." );</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
m_MaxTreeDepth = </font></font><font SIZE="2" face="Courier New">value</font><font SIZE="2"><font face="Courier New">;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">}</font></p>
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">private int m_MaxTreeDepth = 3;</font></td>
</tr>
</table>
</center>
</div>
<p class="dtH4"><font face="Arial">The MaxTreeWidth method gets and sets the
maximum tree width, as specified by the EngineOptions, to be used in <i>
GenerateRandomTree</i> below.</font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber5">
<tr>
<td width="100%"><font SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">public int</font><font SIZE="2"><font face="Courier New">
MaxTreeWidth {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">get</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">return</font><font SIZE="2"><font face="Courier New">
m_MaxTreeWidth;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">set</font><font SIZE="2"><font face="Courier New">
{</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">if( value</font><font SIZE="2"><font face="Courier New">
<= 0 ) {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">throw new
ArgumentOutOfRangeException( "value", value, "The value passed to</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Courier New" SIZE="2">
</font><font SIZE="2"><font face="Courier New"> PrecodeVerifier.MaxTreeDepth
was less than or equal to zero." );</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
m_MaxTreeWidth = </font></font><font SIZE="2" face="Courier New">value</font><font SIZE="2"><font face="Courier New">;</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
}</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">}</font></p>
<p style="margin-top: 0; margin-bottom: 0"></font>
<font SIZE="2" face="Courier New">private int m_MaxTreeWidth = 3;</font></td>
</tr>
</table>
</center>
</div>
<p class="dtH4"><font face="Arial">The GenerateRandomTree generates a random
IPrecodeTree constrained by the maximum tree depth and width.</font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber6">
<tr>
<td width="100%"><font SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
public IPrecodeTree GenerateRandomTree( Random r,
ReadOnlyMethodInfoCollection</font></font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Courier New" size="2"> </font><font SIZE="2"><font face="Courier New">
availableMethods ) {</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">return</font><font SIZE="2"><font face="Courier New">
Instance.GenerateRandomTree( r, availableMethods, MaxTreeDepth,
MaxTreeWidth );</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier New">}</font></font></td>
</tr>
</table>
</center>
</div>
<p class="dtH4"><font face="Arial">The CheckMethod determines if a method can
be used as a node in the IPrecodeTree.</font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber7">
<tr>
<td width="100%"><font SIZE="2"></font>
<font SIZE="2" face="Courier New">public bool</font><font SIZE="2"><font face="Courier New">
CheckMethod( MethodInfo method ) {</font><p><font face="Courier New">
</font></font><font SIZE="2" face="Courier New">return</font><font SIZE="2"><font face="Courier New">
Instance.CheckMethod( method );</font></p>
<p><font face="Courier New">}</font></font></td>
</tr>
</table>
</center>
</div>
<h4 class="dtH4"><font face="Arial">See Also</font></h4>
<p><font face="Arial"><a href="../Internal/EngineOptions.htm">EngineOptions</a>
| <a href="../GPE.htm">GPEngine</a> |
<a href="../ProblemSpace/Precode/IPrecode.htm">IPrecodeTree</a></font></p>
<hr>
<div id="footer">
<font face="Arial">
<a href="http://www.opensource.org/" target="_top">
<img style="padding-bottom: 5px" src="http://opensource.org/trademarks/open_source_button.png" align="left" border="0"></a>
This software licensed under the
<a href="http://opensource.org/licenses/afl-2.1.php" target="_top">Academic
Free License version 2.1</a>. (<a href="../../afl-2.1.txt">Plain
text</a>)</font></div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -