Initial commit
[trapthecap.git] / doc / classes / Population.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <title>Class: Population</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">
13 // <![CDATA[
14
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17 }
18
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
24 else
25 return false;
26
27 elemStyle = elem.style;
28
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
31 } else {
32 elemStyle.display = "none"
33 }
34
35 return true;
36 }
37
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
41 // ]]>
42 </script>
43
44 </head>
45 <body>
46
47
48
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">Population</td>
54 </tr>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
57 <td>
58 <a href="../files/src/selection_rb.html">
59 src/selection.rb
60 </a>
61 <br />
62 <a href="../files/lib/libgenetics_rb.html">
63 lib/libgenetics.rb
64 </a>
65 <br />
66 </td>
67 </tr>
68
69 <tr class="top-aligned-row">
70 <td><strong>Parent:</strong></td>
71 <td>
72 Object
73 </td>
74 </tr>
75 </table>
76 </div>
77 <!-- banner header -->
78
79 <div id="bodyContent">
80
81
82
83 <div id="contextContent">
84
85 <div id="description">
86 <p>
87 A population of genomes
88 </p>
89
90 </div>
91
92
93 </div>
94
95 <div id="method-list">
96 <h3 class="section-bar">Methods</h3>
97
98 <div class="name-list">
99 <a href="#M000019">crossover</a>&nbsp;&nbsp;
100 <a href="#M000021">make_next_generation</a>&nbsp;&nbsp;
101 <a href="#M000020">mutation</a>&nbsp;&nbsp;
102 <a href="#M000018">new</a>&nbsp;&nbsp;
103 <a href="#M000016">tournament_select_one</a>&nbsp;&nbsp;
104 <a href="#M000017">tournament_select_population</a>&nbsp;&nbsp;
105 </div>
106 </div>
107
108 </div>
109
110
111 <!-- if includes -->
112
113 <div id="section">
114
115
116
117
118
119 <div id="attribute-list">
120 <h3 class="section-bar">Attributes</h3>
121
122 <div class="name-list">
123 <table>
124 <tr class="top-aligned-row context-row">
125 <td class="context-item-name">individuals</td>
126 <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
127 <td class="context-item-desc"></td>
128 </tr>
129 </table>
130 </div>
131 </div>
132
133
134
135 <!-- if method_list -->
136 <div id="methods">
137 <h3 class="section-bar">Public Class methods</h3>
138
139 <div id="method-M000018" class="method-detail">
140 <a name="M000018"></a>
141
142 <div class="method-heading">
143 <a href="Population.src/M000018.html" target="Code" class="method-signature"
144 onclick="popupCode('Population.src/M000018.html');return false;">
145 <span class="method-name">new</span><span class="method-args">(population_size, genome_length)</span>
146 </a>
147 </div>
148
149 <div class="method-description">
150 <p>
151 Create a population of a given size
152 </p>
153 </div>
154 </div>
155
156 <h3 class="section-bar">Public Instance methods</h3>
157
158 <div id="method-M000019" class="method-detail">
159 <a name="M000019"></a>
160
161 <div class="method-heading">
162 <a href="Population.src/M000019.html" target="Code" class="method-signature"
163 onclick="popupCode('Population.src/M000019.html');return false;">
164 <span class="method-name">crossover</span><span class="method-args">(crossover_rate)</span>
165 </a>
166 </div>
167
168 <div class="method-description">
169 <p>
170 Perform the <a href="Population.html#M000019">crossover</a> step in a
171 population, giving a <a href="Population.html#M000018">new</a> population
172 </p>
173 </div>
174 </div>
175
176 <div id="method-M000021" class="method-detail">
177 <a name="M000021"></a>
178
179 <div class="method-heading">
180 <a href="Population.src/M000021.html" target="Code" class="method-signature"
181 onclick="popupCode('Population.src/M000021.html');return false;">
182 <span class="method-name">make_next_generation</span><span class="method-args">(tournament_winner_success_rate = 0.8, game_length = 1000, crossover_rate = 0.7, mutation_rate = 0.05)</span>
183 </a>
184 </div>
185
186 <div class="method-description">
187 </div>
188 </div>
189
190 <div id="method-M000020" class="method-detail">
191 <a name="M000020"></a>
192
193 <div class="method-heading">
194 <a href="Population.src/M000020.html" target="Code" class="method-signature"
195 onclick="popupCode('Population.src/M000020.html');return false;">
196 <span class="method-name">mutation</span><span class="method-args">(mutation_rate)</span>
197 </a>
198 </div>
199
200 <div class="method-description">
201 <p>
202 Perform the <a href="Population.html#M000020">mutation</a> step in a
203 population, giving a <a href="Population.html#M000018">new</a> population
204 </p>
205 </div>
206 </div>
207
208 <div id="method-M000016" class="method-detail">
209 <a name="M000016"></a>
210
211 <div class="method-heading">
212 <a href="Population.src/M000016.html" target="Code" class="method-signature"
213 onclick="popupCode('Population.src/M000016.html');return false;">
214 <span class="method-name">tournament_select_one</span><span class="method-args">(winner_success_chance = 0.8, max_game_length= 1000, verbose = false)</span>
215 </a>
216 </div>
217
218 <div class="method-description">
219 <p>
220 Use tournament selection to pick an individual for the next generation
221 </p>
222 </div>
223 </div>
224
225 <div id="method-M000017" class="method-detail">
226 <a name="M000017"></a>
227
228 <div class="method-heading">
229 <a href="Population.src/M000017.html" target="Code" class="method-signature"
230 onclick="popupCode('Population.src/M000017.html');return false;">
231 <span class="method-name">tournament_select_population</span><span class="method-args">(winner_success_chance = 0.8, max_game_length = 1000, verbose = false)</span>
232 </a>
233 </div>
234
235 <div class="method-description">
236 <p>
237 Select a <a href="Population.html#M000018">new</a> population the same size
238 as the current population
239 </p>
240 </div>
241 </div>
242
243
244 </div>
245
246
247 </div>
248
249
250 <div id="validator-badges">
251 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
252 </div>
253
254 </body>
255 </html>