evolvable 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/CHANGELOG.md +24 -0
  4. data/Gemfile +2 -2
  5. data/Gemfile.lock +44 -25
  6. data/README.md +498 -190
  7. data/README_YARD.md +85 -166
  8. data/bin/console +10 -19
  9. data/docs/Evolvable/ClassMethods.html +1233 -0
  10. data/docs/Evolvable/Community/ClassMethods.html +708 -0
  11. data/docs/Evolvable/Community.html +1342 -0
  12. data/docs/Evolvable/CountGene.html +886 -0
  13. data/docs/Evolvable/EqualizeGoal.html +347 -0
  14. data/docs/Evolvable/Error.html +134 -0
  15. data/docs/Evolvable/Evaluation.html +773 -0
  16. data/docs/Evolvable/Evolution.html +616 -0
  17. data/docs/Evolvable/Gene/ClassMethods.html +413 -0
  18. data/docs/Evolvable/Gene.html +522 -0
  19. data/docs/Evolvable/GeneCluster/ClassMethods.html +431 -0
  20. data/docs/Evolvable/GeneCluster.html +280 -0
  21. data/docs/Evolvable/GeneCombination.html +515 -0
  22. data/docs/Evolvable/GeneSpace.html +619 -0
  23. data/docs/Evolvable/Genome.html +1070 -0
  24. data/docs/Evolvable/Goal.html +500 -0
  25. data/docs/Evolvable/MaximizeGoal.html +348 -0
  26. data/docs/Evolvable/MinimizeGoal.html +348 -0
  27. data/docs/Evolvable/Mutation.html +729 -0
  28. data/docs/Evolvable/PointCrossover.html +444 -0
  29. data/docs/Evolvable/Population.html +2826 -0
  30. data/docs/Evolvable/RigidCountGene.html +501 -0
  31. data/docs/Evolvable/Selection.html +594 -0
  32. data/docs/Evolvable/Serializer.html +293 -0
  33. data/docs/Evolvable/UniformCrossover.html +286 -0
  34. data/docs/Evolvable.html +1619 -0
  35. data/docs/_index.html +341 -0
  36. data/docs/class_list.html +54 -0
  37. data/docs/css/common.css +1 -0
  38. data/docs/css/full_list.css +58 -0
  39. data/docs/css/style.css +503 -0
  40. data/docs/file.README.html +750 -0
  41. data/docs/file_list.html +59 -0
  42. data/docs/frames.html +22 -0
  43. data/docs/index.html +750 -0
  44. data/docs/js/app.js +344 -0
  45. data/docs/js/full_list.js +242 -0
  46. data/docs/js/jquery.js +4 -0
  47. data/docs/method_list.html +1302 -0
  48. data/docs/top-level-namespace.html +110 -0
  49. data/evolvable.gemspec +6 -6
  50. data/examples/ascii_art.rb +5 -9
  51. data/examples/stickman.rb +25 -33
  52. data/{examples/hello_world.rb → exe/hello_evolvable_world} +46 -30
  53. data/lib/evolvable/community.rb +190 -0
  54. data/lib/evolvable/count_gene.rb +65 -0
  55. data/lib/evolvable/equalize_goal.rb +2 -9
  56. data/lib/evolvable/evaluation.rb +113 -14
  57. data/lib/evolvable/evolution.rb +38 -15
  58. data/lib/evolvable/gene.rb +124 -25
  59. data/lib/evolvable/gene_cluster.rb +106 -0
  60. data/lib/evolvable/gene_combination.rb +57 -16
  61. data/lib/evolvable/gene_space.rb +111 -0
  62. data/lib/evolvable/genome.rb +32 -4
  63. data/lib/evolvable/goal.rb +19 -24
  64. data/lib/evolvable/maximize_goal.rb +2 -9
  65. data/lib/evolvable/minimize_goal.rb +3 -9
  66. data/lib/evolvable/mutation.rb +87 -41
  67. data/lib/evolvable/point_crossover.rb +24 -4
  68. data/lib/evolvable/population.rb +258 -84
  69. data/lib/evolvable/rigid_count_gene.rb +36 -0
  70. data/lib/evolvable/selection.rb +68 -14
  71. data/lib/evolvable/serializer.rb +46 -0
  72. data/lib/evolvable/uniform_crossover.rb +30 -6
  73. data/lib/evolvable/version.rb +2 -1
  74. data/lib/evolvable.rb +268 -107
  75. metadata +57 -36
  76. data/examples/images/diagram.png +0 -0
  77. data/exe/hello +0 -16
  78. data/lib/evolvable/error/undefined_method.rb +0 -7
  79. data/lib/evolvable/search_space.rb +0 -181
@@ -0,0 +1,293 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Evolvable::Serializer
8
+
9
+ &mdash; Documentation by YARD 0.9.37
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Evolvable::Serializer";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span>
41
+ &raquo;
42
+ <span class="title">Serializer</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Evolvable::Serializer
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Evolvable::Serializer</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/evolvable/serializer.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p>Evolvable supports saving and restoring the state of both populations
105
+ and individual evolvable instances through a built-in <code>Serializer</code>.
106
+ By default, it uses Ruby&#39;s <code>Marshal</code> class for fast, portable binary serialization.</p>
107
+
108
+ <p>Serialization is useful for:</p>
109
+
110
+ <ul>
111
+ <li>Saving progress during long-running evolution</li>
112
+ <li>Storing champion solutions for later reuse</li>
113
+ <li>Transferring evolved populations between systems</li>
114
+ <li>Creating checkpoints you can revert to</li>
115
+ </ul>
116
+
117
+ <p>Both <code>Population</code> and individual evolvables expose <code>dump</code> and <code>load</code> methods
118
+ that use the <code>Serializer</code> internally.</p>
119
+
120
+ <p>Save a population to a file:</p>
121
+
122
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span> <span class='op'>=</span> <span class='const'>YourEvolvable</span><span class='period'>.</span><span class='id identifier rubyid_new_population'>new_population</span>
123
+ <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_evolve'>evolve</span><span class='lparen'>(</span><span class='label'>count:</span> <span class='int'>100</span><span class='rparen'>)</span>
124
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>population.marshal</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span><span class='rparen'>)</span>
125
+ </code></pre>
126
+
127
+ <p>Restore and continue evolution:</p>
128
+
129
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>population.marshal</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
130
+ <span class='id identifier rubyid_restored'>restored</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Population</a></span></span><span class='period'>.</span><span class='id identifier rubyid_load'><span class='object_link'><a href="Population.html#load-class_method" title="Evolvable::Population.load (method)">load</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
131
+ <span class='id identifier rubyid_restored'>restored</span><span class='period'>.</span><span class='id identifier rubyid_evolve'>evolve</span><span class='lparen'>(</span><span class='label'>count:</span> <span class='int'>100</span><span class='rparen'>)</span>
132
+ </code></pre>
133
+
134
+ <p>Save an individual evolvable&#39;s genome:</p>
135
+
136
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_best'>best</span> <span class='op'>=</span> <span class='id identifier rubyid_restored'>restored</span><span class='period'>.</span><span class='id identifier rubyid_best_evolvable'>best_evolvable</span>
137
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>champion.marshal</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_best'>best</span><span class='period'>.</span><span class='id identifier rubyid_dump_genome'>dump_genome</span><span class='rparen'>)</span>
138
+ </code></pre>
139
+
140
+ <p>Restore genome into a new evolvable:</p>
141
+
142
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_raw'>raw</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>champion.marshal</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
143
+ <span class='id identifier rubyid_champion'>champion</span> <span class='op'>=</span> <span class='const'>YourEvolvable</span><span class='period'>.</span><span class='id identifier rubyid_new_evolvable'>new_evolvable</span>
144
+ <span class='id identifier rubyid_champion'>champion</span><span class='period'>.</span><span class='id identifier rubyid_load_genome'>load_genome</span><span class='lparen'>(</span><span class='id identifier rubyid_raw'>raw</span><span class='rparen'>)</span>
145
+ </code></pre>
146
+
147
+
148
+ </div>
149
+ </div>
150
+ <div class="tags">
151
+
152
+
153
+ </div>
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ <h2>
162
+ Class Method Summary
163
+ <small><a href="#" class="summary_toggle">collapse</a></small>
164
+ </h2>
165
+
166
+ <ul class="summary">
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#dump-class_method" title="dump (class method)">.<strong>dump</strong>(data) &#x21d2; Object </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'></div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#load-class_method" title="load (class method)">.<strong>load</strong>(data) &#x21d2; Object </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <span class="summary_desc"><div class='inline'></div></span>
208
+
209
+ </li>
210
+
211
+
212
+ </ul>
213
+
214
+
215
+
216
+
217
+ <div id="class_method_details" class="method_details_list">
218
+ <h2>Class Method Details</h2>
219
+
220
+
221
+ <div class="method_details first">
222
+ <h3 class="signature first" id="dump-class_method">
223
+
224
+ .<strong>dump</strong>(data) &#x21d2; <tt>Object</tt>
225
+
226
+
227
+
228
+
229
+
230
+ </h3><table class="source_code">
231
+ <tr>
232
+ <td>
233
+ <pre class="lines">
234
+
235
+
236
+ 52
237
+ 53
238
+ 54</pre>
239
+ </td>
240
+ <td>
241
+ <pre class="code"><span class="info file"># File 'lib/evolvable/serializer.rb', line 52</span>
242
+
243
+ <span class='kw'>def</span> <span class='id identifier rubyid_dump'>dump</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
244
+ <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
245
+ <span class='kw'>end</span></pre>
246
+ </td>
247
+ </tr>
248
+ </table>
249
+ </div>
250
+
251
+ <div class="method_details ">
252
+ <h3 class="signature " id="load-class_method">
253
+
254
+ .<strong>load</strong>(data) &#x21d2; <tt>Object</tt>
255
+
256
+
257
+
258
+
259
+
260
+ </h3><table class="source_code">
261
+ <tr>
262
+ <td>
263
+ <pre class="lines">
264
+
265
+
266
+ 56
267
+ 57
268
+ 58</pre>
269
+ </td>
270
+ <td>
271
+ <pre class="code"><span class="info file"># File 'lib/evolvable/serializer.rb', line 56</span>
272
+
273
+ <span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
274
+ <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
275
+ <span class='kw'>end</span></pre>
276
+ </td>
277
+ </tr>
278
+ </table>
279
+ </div>
280
+
281
+ </div>
282
+
283
+ </div>
284
+
285
+ <div id="footer">
286
+ Generated on Sat May 10 18:39:22 2025 by
287
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
288
+ 0.9.37 (ruby-3.4.2).
289
+ </div>
290
+
291
+ </div>
292
+ </body>
293
+ </html>
@@ -0,0 +1,286 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Evolvable::UniformCrossover
8
+
9
+ &mdash; Documentation by YARD 0.9.37
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Evolvable::UniformCrossover";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (U)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span>
41
+ &raquo;
42
+ <span class="title">UniformCrossover</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Evolvable::UniformCrossover
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Evolvable::UniformCrossover</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/evolvable/uniform_crossover.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p>Chooses genes independently at each position, selecting randomly from either
105
+ parent with equal probability. No segments are preserved—each gene is treated
106
+ in isolation.</p>
107
+
108
+ <p>Best for:</p>
109
+
110
+ <ul>
111
+ <li>Problems where gene order doesn&#39;t matter</li>
112
+ <li>High genetic diversity and exploration</li>
113
+ <li>Complex interdependencies across traits</li>
114
+ </ul>
115
+
116
+ <p>Uniform crossover is especially effective when good traits are scattered across the genome.</p>
117
+
118
+ <p>Set your population to use this strategy during initialization with:</p>
119
+
120
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span> <span class='op'>=</span> <span class='const'>MyEvolvable</span><span class='period'>.</span><span class='id identifier rubyid_new_population'>new_population</span><span class='lparen'>(</span>
121
+ <span class='label'>combination:</span> <span class='const'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span><span class='op'>::</span><span class='const'>UniformCrossover</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
122
+ <span class='rparen'>)</span>
123
+ </code></pre>
124
+
125
+ <p>Or update an existing population:</p>
126
+
127
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_combination'>combination</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span><span class='op'>::</span><span class='const'>UniformCrossover</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
128
+ </code></pre>
129
+
130
+
131
+ </div>
132
+ </div>
133
+ <div class="tags">
134
+
135
+
136
+ </div>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <h2>
145
+ Instance Method Summary
146
+ <small><a href="#" class="summary_toggle">collapse</a></small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(population) &#x21d2; Object </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'></div></span>
169
+
170
+ </li>
171
+
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#new_evolvables-instance_method" title="#new_evolvables (instance method)">#<strong>new_evolvables</strong>(population, count) &#x21d2; Object </a>
177
+
178
+
179
+
180
+ </span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <span class="summary_desc"><div class='inline'></div></span>
191
+
192
+ </li>
193
+
194
+
195
+ </ul>
196
+
197
+
198
+
199
+
200
+ <div id="instance_method_details" class="method_details_list">
201
+ <h2>Instance Method Details</h2>
202
+
203
+
204
+ <div class="method_details first">
205
+ <h3 class="signature first" id="call-instance_method">
206
+
207
+ #<strong>call</strong>(population) &#x21d2; <tt>Object</tt>
208
+
209
+
210
+
211
+
212
+
213
+ </h3><table class="source_code">
214
+ <tr>
215
+ <td>
216
+ <pre class="lines">
217
+
218
+
219
+ 32
220
+ 33
221
+ 34
222
+ 35</pre>
223
+ </td>
224
+ <td>
225
+ <pre class="code"><span class="info file"># File 'lib/evolvable/uniform_crossover.rb', line 32</span>
226
+
227
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_population'>population</span><span class='rparen'>)</span>
228
+ <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_evolvables'>evolvables</span> <span class='op'>=</span> <span class='id identifier rubyid_new_evolvables'>new_evolvables</span><span class='lparen'>(</span><span class='id identifier rubyid_population'>population</span><span class='comma'>,</span> <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
229
+ <span class='id identifier rubyid_population'>population</span>
230
+ <span class='kw'>end</span></pre>
231
+ </td>
232
+ </tr>
233
+ </table>
234
+ </div>
235
+
236
+ <div class="method_details ">
237
+ <h3 class="signature " id="new_evolvables-instance_method">
238
+
239
+ #<strong>new_evolvables</strong>(population, count) &#x21d2; <tt>Object</tt>
240
+
241
+
242
+
243
+
244
+
245
+ </h3><table class="source_code">
246
+ <tr>
247
+ <td>
248
+ <pre class="lines">
249
+
250
+
251
+ 37
252
+ 38
253
+ 39
254
+ 40
255
+ 41
256
+ 42
257
+ 43</pre>
258
+ </td>
259
+ <td>
260
+ <pre class="code"><span class="info file"># File 'lib/evolvable/uniform_crossover.rb', line 37</span>
261
+
262
+ <span class='kw'>def</span> <span class='id identifier rubyid_new_evolvables'>new_evolvables</span><span class='lparen'>(</span><span class='id identifier rubyid_population'>population</span><span class='comma'>,</span> <span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
263
+ <span class='id identifier rubyid_parent_genome_cycle'>parent_genome_cycle</span> <span class='op'>=</span> <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_new_parent_genome_cycle'>new_parent_genome_cycle</span>
264
+ <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span> <span class='kw'>do</span>
265
+ <span class='id identifier rubyid_genome'>genome</span> <span class='op'>=</span> <span class='id identifier rubyid_build_genome'>build_genome</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_genome_cycle'>parent_genome_cycle</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='rparen'>)</span>
266
+ <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_new_evolvable'>new_evolvable</span><span class='lparen'>(</span><span class='label'>genome:</span> <span class='id identifier rubyid_genome'>genome</span><span class='rparen'>)</span>
267
+ <span class='kw'>end</span>
268
+ <span class='kw'>end</span></pre>
269
+ </td>
270
+ </tr>
271
+ </table>
272
+ </div>
273
+
274
+ </div>
275
+
276
+ </div>
277
+
278
+ <div id="footer">
279
+ Generated on Sat May 10 18:39:22 2025 by
280
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
281
+ 0.9.37 (ruby-3.4.2).
282
+ </div>
283
+
284
+ </div>
285
+ </body>
286
+ </html>