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,594 @@
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::Selection
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::Selection";
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">Selection</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::Selection
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::Selection</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+ <dl>
89
+ <dt>Extended by:</dt>
90
+ <dd>Forwardable</dd>
91
+ </dl>
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/evolvable/selection.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+ <p>Selection determines which evolvables will serve as parents for the next
110
+ generation. You can control the selection process in several ways:</p>
111
+
112
+ <p>Set the selection size during population initialization:</p>
113
+
114
+ <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>
115
+ <span class='label'>selection:</span> <span class='lbrace'>{</span> <span class='label'>size:</span> <span class='int'>3</span> <span class='rbrace'>}</span>
116
+ <span class='rparen'>)</span>
117
+ </code></pre>
118
+
119
+ <p>Adjust the selection size after initialization:</p>
120
+
121
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_selection_size'>selection_size</span> <span class='op'>=</span> <span class='int'>4</span>
122
+ </code></pre>
123
+
124
+ <p>Manually assign the selected evolvables:</p>
125
+
126
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_selected_evolvables'>selected_evolvables</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_evolvable1'>evolvable1</span><span class='comma'>,</span> <span class='id identifier rubyid_evolvable2'>evolvable2</span><span class='rbracket'>]</span>
127
+ </code></pre>
128
+
129
+ <p>Or evolve a custom selection directly:</p>
130
+
131
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_evolve_selected'>evolve_selected</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_evolvable1'>evolvable1</span><span class='comma'>,</span> <span class='id identifier rubyid_evolvable2'>evolvable2</span><span class='rbracket'>]</span><span class='rparen'>)</span>
132
+ </code></pre>
133
+
134
+ <p>This flexibility lets you implement custom selection strategies,
135
+ overriding or augmenting the built-in behavior.</p>
136
+
137
+
138
+ </div>
139
+ </div>
140
+ <div class="tags">
141
+
142
+
143
+ </div>
144
+
145
+
146
+
147
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
148
+ <ul class="summary">
149
+
150
+ <li class="public ">
151
+ <span class="summary_signature">
152
+
153
+ <a href="#size-instance_method" title="#size (instance method)">#<strong>size</strong> &#x21d2; Integer </a>
154
+
155
+
156
+
157
+ </span>
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <span class="summary_desc"><div class='inline'><p>The number of evolvables to select as parents for the next generation.</p>
171
+ </div></span>
172
+
173
+ </li>
174
+
175
+
176
+ </ul>
177
+
178
+
179
+
180
+
181
+
182
+ <h2>
183
+ Instance Method Summary
184
+ <small><a href="#" class="summary_toggle">collapse</a></small>
185
+ </h2>
186
+
187
+ <ul class="summary">
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(population) &#x21d2; Evolvable::Population </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'><p>Performs selection on the population.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(size: 2) &#x21d2; Selection </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+ <span class="note title constructor">constructor</span>
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'><p>Initializes a new selection object.</p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ <li class="public ">
238
+ <span class="summary_signature">
239
+
240
+ <a href="#select_evolvables-instance_method" title="#select_evolvables (instance method)">#<strong>select_evolvables</strong>(evolvables) &#x21d2; Array&lt;Evolvable&gt; </a>
241
+
242
+
243
+
244
+ </span>
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+ <span class="summary_desc"><div class='inline'><p>Selects the best evolvables from the given collection.</p>
255
+ </div></span>
256
+
257
+ </li>
258
+
259
+
260
+ </ul>
261
+
262
+
263
+
264
+ <div id="constructor_details" class="method_details_list">
265
+ <h2>Constructor Details</h2>
266
+
267
+ <div class="method_details first">
268
+ <h3 class="signature first" id="initialize-instance_method">
269
+
270
+ #<strong>initialize</strong>(size: 2) &#x21d2; <tt><span class='object_link'><a href="" title="Evolvable::Selection (class)">Selection</a></span></tt>
271
+
272
+
273
+
274
+
275
+
276
+ </h3><div class="docstring">
277
+ <div class="discussion">
278
+ <p>Initializes a new selection object.</p>
279
+
280
+
281
+ </div>
282
+ </div>
283
+ <div class="tags">
284
+ <p class="tag_title">Parameters:</p>
285
+ <ul class="param">
286
+
287
+ <li>
288
+
289
+ <span class='name'>size</span>
290
+
291
+
292
+ <span class='type'>(<tt>Integer</tt>)</span>
293
+
294
+
295
+ <em class="default">(defaults to: <tt>2</tt>)</em>
296
+
297
+
298
+ &mdash;
299
+ <div class='inline'><p>The number of instances to select from each generation
300
+ to perform crossover and generate or &quot;breed&quot; the next generation.
301
+ The default is 2.</p>
302
+ </div>
303
+
304
+ </li>
305
+
306
+ </ul>
307
+
308
+
309
+ </div><table class="source_code">
310
+ <tr>
311
+ <td>
312
+ <pre class="lines">
313
+
314
+
315
+ 48
316
+ 49
317
+ 50</pre>
318
+ </td>
319
+ <td>
320
+ <pre class="code"><span class="info file"># File 'lib/evolvable/selection.rb', line 48</span>
321
+
322
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>size:</span> <span class='int'>2</span><span class='rparen'>)</span>
323
+ <span class='ivar'>@size</span> <span class='op'>=</span> <span class='id identifier rubyid_size'>size</span>
324
+ <span class='kw'>end</span></pre>
325
+ </td>
326
+ </tr>
327
+ </table>
328
+ </div>
329
+
330
+ </div>
331
+
332
+ <div id="instance_attr_details" class="attr_details">
333
+ <h2>Instance Attribute Details</h2>
334
+
335
+
336
+ <span id="size=-instance_method"></span>
337
+ <div class="method_details first">
338
+ <h3 class="signature first" id="size-instance_method">
339
+
340
+ #<strong>size</strong> &#x21d2; <tt>Integer</tt>
341
+
342
+
343
+
344
+
345
+
346
+ </h3><div class="docstring">
347
+ <div class="discussion">
348
+ <p>The number of evolvables to select as parents for the next generation.</p>
349
+
350
+
351
+ </div>
352
+ </div>
353
+ <div class="tags">
354
+
355
+ <p class="tag_title">Returns:</p>
356
+ <ul class="return">
357
+
358
+ <li>
359
+
360
+
361
+ <span class='type'>(<tt>Integer</tt>)</span>
362
+
363
+
364
+
365
+ &mdash;
366
+ <div class='inline'><p>The selection size</p>
367
+ </div>
368
+
369
+ </li>
370
+
371
+ </ul>
372
+
373
+ </div><table class="source_code">
374
+ <tr>
375
+ <td>
376
+ <pre class="lines">
377
+
378
+
379
+ 56
380
+ 57
381
+ 58</pre>
382
+ </td>
383
+ <td>
384
+ <pre class="code"><span class="info file"># File 'lib/evolvable/selection.rb', line 56</span>
385
+
386
+ <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
387
+ <span class='ivar'>@size</span>
388
+ <span class='kw'>end</span></pre>
389
+ </td>
390
+ </tr>
391
+ </table>
392
+ </div>
393
+
394
+ </div>
395
+
396
+
397
+ <div id="instance_method_details" class="method_details_list">
398
+ <h2>Instance Method Details</h2>
399
+
400
+
401
+ <div class="method_details first">
402
+ <h3 class="signature first" id="call-instance_method">
403
+
404
+ #<strong>call</strong>(population) &#x21d2; <tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>
405
+
406
+
407
+
408
+
409
+
410
+ </h3><div class="docstring">
411
+ <div class="discussion">
412
+ <p>Performs selection on the population.
413
+ Takes the evaluated and sorted evolvables and selects a subset to
414
+ become parents for the next generation.</p>
415
+
416
+
417
+ </div>
418
+ </div>
419
+ <div class="tags">
420
+ <p class="tag_title">Parameters:</p>
421
+ <ul class="param">
422
+
423
+ <li>
424
+
425
+ <span class='name'>population</span>
426
+
427
+
428
+ <span class='type'>(<tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>)</span>
429
+
430
+
431
+
432
+ &mdash;
433
+ <div class='inline'><p>The population to perform selection on</p>
434
+ </div>
435
+
436
+ </li>
437
+
438
+ </ul>
439
+
440
+ <p class="tag_title">Returns:</p>
441
+ <ul class="return">
442
+
443
+ <li>
444
+
445
+
446
+ <span class='type'>(<tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>)</span>
447
+
448
+
449
+
450
+ &mdash;
451
+ <div class='inline'><p>The population with selected parent evolvables</p>
452
+ </div>
453
+
454
+ </li>
455
+
456
+ </ul>
457
+
458
+ </div><table class="source_code">
459
+ <tr>
460
+ <td>
461
+ <pre class="lines">
462
+
463
+
464
+ 66
465
+ 67
466
+ 68
467
+ 69
468
+ 70
469
+ 71</pre>
470
+ </td>
471
+ <td>
472
+ <pre class="code"><span class="info file"># File 'lib/evolvable/selection.rb', line 66</span>
473
+
474
+ <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>
475
+ <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_parent_evolvables'>parent_evolvables</span> <span class='op'>=</span> <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_selected_evolvables'>selected_evolvables</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='id identifier rubyid_select_evolvables'>select_evolvables</span><span class='lparen'>(</span><span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_evolvables'>evolvables</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_selected_evolvables'>selected_evolvables</span>
476
+ <span class='id identifier rubyid_population'>population</span><span class='period'>.</span><span class='id identifier rubyid_selected_evolvables'>selected_evolvables</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
477
+ <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='lbracket'>[</span><span class='rbracket'>]</span>
478
+ <span class='id identifier rubyid_population'>population</span>
479
+ <span class='kw'>end</span></pre>
480
+ </td>
481
+ </tr>
482
+ </table>
483
+ </div>
484
+
485
+ <div class="method_details ">
486
+ <h3 class="signature " id="select_evolvables-instance_method">
487
+
488
+ #<strong>select_evolvables</strong>(evolvables) &#x21d2; <tt>Array&lt;<span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span>&gt;</tt>
489
+
490
+
491
+
492
+
493
+
494
+ </h3><div class="docstring">
495
+ <div class="discussion">
496
+ <p>Selects the best evolvables from the given collection.
497
+ By default, selects the last N evolvables, where N is the selection size.
498
+ This assumes evolvables are already sorted in the evaluation step, with the best at the end.</p>
499
+
500
+ <p>Override this method in a subclass to implement different selection strategies
501
+ such as tournament selection or roulette wheel selection.</p>
502
+
503
+
504
+ </div>
505
+ </div>
506
+ <div class="tags">
507
+
508
+ <div class="examples">
509
+ <h4 class="tag_title">Examples:</h4>
510
+
511
+
512
+ <pre class="example code"><code><span class='comment'># A custom selection strategy using tournament selection
513
+ </span><span class='kw'>class</span> <span class='const'>TournamentSelection</span> <span class='op'>&lt;</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="" title="Evolvable::Selection (class)">Selection</a></span></span>
514
+ <span class='kw'>def</span> <span class='id identifier rubyid_select_evolvables'>select_evolvables</span><span class='lparen'>(</span><span class='id identifier rubyid_evolvables'>evolvables</span><span class='rparen'>)</span>
515
+ <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_size'>size</span><span class='rparen'>)</span> <span class='kw'>do</span>
516
+ <span class='comment'># Randomly select 3 individuals and pick the best one
517
+ </span> <span class='id identifier rubyid_evolvables'>evolvables</span><span class='period'>.</span><span class='id identifier rubyid_sample'>sample</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_max_by'>max_by</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:fitness</span><span class='rparen'>)</span>
518
+ <span class='kw'>end</span>
519
+ <span class='kw'>end</span>
520
+ <span class='kw'>end</span></code></pre>
521
+
522
+ </div>
523
+ <p class="tag_title">Parameters:</p>
524
+ <ul class="param">
525
+
526
+ <li>
527
+
528
+ <span class='name'>evolvables</span>
529
+
530
+
531
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span>&gt;</tt>)</span>
532
+
533
+
534
+
535
+ &mdash;
536
+ <div class='inline'><p>The evolvables to select from</p>
537
+ </div>
538
+
539
+ </li>
540
+
541
+ </ul>
542
+
543
+ <p class="tag_title">Returns:</p>
544
+ <ul class="return">
545
+
546
+ <li>
547
+
548
+
549
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span>&gt;</tt>)</span>
550
+
551
+
552
+
553
+ &mdash;
554
+ <div class='inline'><p>The selected evolvables to use as parents</p>
555
+ </div>
556
+
557
+ </li>
558
+
559
+ </ul>
560
+
561
+ </div><table class="source_code">
562
+ <tr>
563
+ <td>
564
+ <pre class="lines">
565
+
566
+
567
+ 95
568
+ 96
569
+ 97</pre>
570
+ </td>
571
+ <td>
572
+ <pre class="code"><span class="info file"># File 'lib/evolvable/selection.rb', line 95</span>
573
+
574
+ <span class='kw'>def</span> <span class='id identifier rubyid_select_evolvables'>select_evolvables</span><span class='lparen'>(</span><span class='id identifier rubyid_evolvables'>evolvables</span><span class='rparen'>)</span>
575
+ <span class='id identifier rubyid_evolvables'>evolvables</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lparen'>(</span><span class='ivar'>@size</span><span class='rparen'>)</span>
576
+ <span class='kw'>end</span></pre>
577
+ </td>
578
+ </tr>
579
+ </table>
580
+ </div>
581
+
582
+ </div>
583
+
584
+ </div>
585
+
586
+ <div id="footer">
587
+ Generated on Sat May 10 18:39:22 2025 by
588
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
589
+ 0.9.37 (ruby-3.4.2).
590
+ </div>
591
+
592
+ </div>
593
+ </body>
594
+ </html>