1 <?xml version="1.0" encoding="iso-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8 <title>Class: Potential_player</title>
9 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10 <meta http-equiv="Content-Script-Type" content="text/javascript" />
11 <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12 <script type="text/javascript">
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
27 elemStyle = elem.style;
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
32 elemStyle.display = "none"
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
49 <div id="classHeader">
50 <table class="header-table">
51 <tr class="top-aligned-row">
52 <td><strong>Class</strong></td>
53 <td class="class-name-in-header">Potential_player</td>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
58 <a href="../files/lib/libpplayer_rb.html">
65 <tr class="top-aligned-row">
66 <td><strong>Parent:</strong></td>
73 <!-- banner header -->
75 <div id="bodyContent">
79 <div id="contextContent">
81 <div id="description">
83 Play Trap the Cap by using potential fields. For each possible move,
84 calculate the field strength and pick the move with the lowest potential
92 <div id="method-list">
93 <h3 class="section-bar">Methods</h3>
95 <div class="name-list">
96 <a href="#M000007">best_move</a>
97 <a href="#M000006">new</a>
98 <a href="#M000008">score_position</a>
99 <a href="#M000009">to_bitstring</a>
100 <a href="#M000010">to_genome</a>
115 <div id="attribute-list">
116 <h3 class="section-bar">Attributes</h3>
118 <div class="name-list">
120 <tr class="top-aligned-row context-row">
121 <td class="context-item-name">base_pull</td>
122 <td class="context-item-value"> [R] </td>
123 <td class="context-item-desc"></td>
125 <tr class="top-aligned-row context-row">
126 <td class="context-item-name">capture_bonus</td>
127 <td class="context-item-value"> [R] </td>
128 <td class="context-item-desc"></td>
130 <tr class="top-aligned-row context-row">
131 <td class="context-item-name">enemy_pull</td>
132 <td class="context-item-value"> [R] </td>
133 <td class="context-item-desc"></td>
135 <tr class="top-aligned-row context-row">
136 <td class="context-item-name">friend_pull</td>
137 <td class="context-item-value"> [R] </td>
138 <td class="context-item-desc"></td>
140 <tr class="top-aligned-row context-row">
141 <td class="context-item-name">safe_bonus</td>
142 <td class="context-item-value"> [R] </td>
143 <td class="context-item-desc"></td>
151 <!-- if method_list -->
153 <h3 class="section-bar">Public Class methods</h3>
155 <div id="method-M000006" class="method-detail">
156 <a name="M000006"></a>
158 <div class="method-heading">
159 <a href="Potential_player.src/M000006.html" target="Code" class="method-signature"
160 onclick="popupCode('Potential_player.src/M000006.html');return false;">
161 <span class="method-name">new</span><span class="method-args">(args, verbose = false)</span>
165 <div class="method-description">
169 <h3 class="section-bar">Public Instance methods</h3>
171 <div id="method-M000007" class="method-detail">
172 <a name="M000007"></a>
174 <div class="method-heading">
175 <a href="Potential_player.src/M000007.html" target="Code" class="method-signature"
176 onclick="popupCode('Potential_player.src/M000007.html');return false;">
177 <span class="method-name">best_move</span><span class="method-args">(game, die_result)</span>
181 <div class="method-description">
183 Find the best move of the possible ones
188 <div id="method-M000008" class="method-detail">
189 <a name="M000008"></a>
191 <div class="method-heading">
192 <a href="Potential_player.src/M000008.html" target="Code" class="method-signature"
193 onclick="popupCode('Potential_player.src/M000008.html');return false;">
194 <span class="method-name">score_position</span><span class="method-args">(game, player)</span>
198 <div class="method-description">
200 Calculate the potential score of a position for a given player
205 <div id="method-M000009" class="method-detail">
206 <a name="M000009"></a>
208 <div class="method-heading">
209 <a href="Potential_player.src/M000009.html" target="Code" class="method-signature"
210 onclick="popupCode('Potential_player.src/M000009.html');return false;">
211 <span class="method-name">to_bitstring</span><span class="method-args">()</span>
215 <div class="method-description">
217 Convert a player to a bitstring
222 <div id="method-M000010" class="method-detail">
223 <a name="M000010"></a>
225 <div class="method-heading">
226 <a href="Potential_player.src/M000010.html" target="Code" class="method-signature"
227 onclick="popupCode('Potential_player.src/M000010.html');return false;">
228 <span class="method-name">to_genome</span><span class="method-args">()</span>
232 <div class="method-description">
234 Convert a player to a genome
246 <div id="validator-badges">
247 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>