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.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/CHANGELOG.md +24 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +44 -25
- data/README.md +498 -190
- data/README_YARD.md +85 -166
- data/bin/console +10 -19
- data/docs/Evolvable/ClassMethods.html +1233 -0
- data/docs/Evolvable/Community/ClassMethods.html +708 -0
- data/docs/Evolvable/Community.html +1342 -0
- data/docs/Evolvable/CountGene.html +886 -0
- data/docs/Evolvable/EqualizeGoal.html +347 -0
- data/docs/Evolvable/Error.html +134 -0
- data/docs/Evolvable/Evaluation.html +773 -0
- data/docs/Evolvable/Evolution.html +616 -0
- data/docs/Evolvable/Gene/ClassMethods.html +413 -0
- data/docs/Evolvable/Gene.html +522 -0
- data/docs/Evolvable/GeneCluster/ClassMethods.html +431 -0
- data/docs/Evolvable/GeneCluster.html +280 -0
- data/docs/Evolvable/GeneCombination.html +515 -0
- data/docs/Evolvable/GeneSpace.html +619 -0
- data/docs/Evolvable/Genome.html +1070 -0
- data/docs/Evolvable/Goal.html +500 -0
- data/docs/Evolvable/MaximizeGoal.html +348 -0
- data/docs/Evolvable/MinimizeGoal.html +348 -0
- data/docs/Evolvable/Mutation.html +729 -0
- data/docs/Evolvable/PointCrossover.html +444 -0
- data/docs/Evolvable/Population.html +2826 -0
- data/docs/Evolvable/RigidCountGene.html +501 -0
- data/docs/Evolvable/Selection.html +594 -0
- data/docs/Evolvable/Serializer.html +293 -0
- data/docs/Evolvable/UniformCrossover.html +286 -0
- data/docs/Evolvable.html +1619 -0
- data/docs/_index.html +341 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.README.html +750 -0
- data/docs/file_list.html +59 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +750 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1302 -0
- data/docs/top-level-namespace.html +110 -0
- data/evolvable.gemspec +6 -6
- data/examples/ascii_art.rb +5 -9
- data/examples/stickman.rb +25 -33
- data/{examples/hello_world.rb → exe/hello_evolvable_world} +46 -30
- data/lib/evolvable/community.rb +190 -0
- data/lib/evolvable/count_gene.rb +65 -0
- data/lib/evolvable/equalize_goal.rb +2 -9
- data/lib/evolvable/evaluation.rb +113 -14
- data/lib/evolvable/evolution.rb +38 -15
- data/lib/evolvable/gene.rb +124 -25
- data/lib/evolvable/gene_cluster.rb +106 -0
- data/lib/evolvable/gene_combination.rb +57 -16
- data/lib/evolvable/gene_space.rb +111 -0
- data/lib/evolvable/genome.rb +32 -4
- data/lib/evolvable/goal.rb +19 -24
- data/lib/evolvable/maximize_goal.rb +2 -9
- data/lib/evolvable/minimize_goal.rb +3 -9
- data/lib/evolvable/mutation.rb +87 -41
- data/lib/evolvable/point_crossover.rb +24 -4
- data/lib/evolvable/population.rb +258 -84
- data/lib/evolvable/rigid_count_gene.rb +36 -0
- data/lib/evolvable/selection.rb +68 -14
- data/lib/evolvable/serializer.rb +46 -0
- data/lib/evolvable/uniform_crossover.rb +30 -6
- data/lib/evolvable/version.rb +2 -1
- data/lib/evolvable.rb +268 -107
- metadata +57 -36
- data/examples/images/diagram.png +0 -0
- data/exe/hello +0 -16
- data/lib/evolvable/error/undefined_method.rb +0 -7
- data/lib/evolvable/search_space.rb +0 -181
@@ -0,0 +1,616 @@
|
|
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::Evolution
|
8
|
+
|
9
|
+
— 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::Evolution";
|
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 (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Evolvable.html" title="Evolvable (module)">Evolvable</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Evolution</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::Evolution
|
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::Evolution</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/evolution.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
<p><strong>Evolution</strong> moves a population from one generation to the next.
|
110
|
+
It runs in three steps: selection, combination, and mutation.
|
111
|
+
You can swap out any step with your own strategy.</p>
|
112
|
+
|
113
|
+
<p>Default pipeline:</p>
|
114
|
+
|
115
|
+
<ol>
|
116
|
+
<li><strong>Selection</strong> – keep the most fit evolvables</li>
|
117
|
+
<li><strong>Combination</strong> – create offspring by recombining genes</li>
|
118
|
+
<li><strong>Mutation</strong> – add random variation to preserve diversity</li>
|
119
|
+
</ol>
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<div class="tags">
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
132
|
+
<ul class="summary">
|
133
|
+
|
134
|
+
<li class="public ">
|
135
|
+
<span class="summary_signature">
|
136
|
+
|
137
|
+
<a href="#combination-instance_method" title="#combination (instance method)">#<strong>combination</strong> ⇒ Object </a>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
</span>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute combination.</p>
|
155
|
+
</div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#mutation-instance_method" title="#mutation (instance method)">#<strong>mutation</strong> ⇒ Object </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute mutation.</p>
|
181
|
+
</div></span>
|
182
|
+
|
183
|
+
</li>
|
184
|
+
|
185
|
+
|
186
|
+
<li class="public ">
|
187
|
+
<span class="summary_signature">
|
188
|
+
|
189
|
+
<a href="#selection-instance_method" title="#selection (instance method)">#<strong>selection</strong> ⇒ Object </a>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</span>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute selection.</p>
|
207
|
+
</div></span>
|
208
|
+
|
209
|
+
</li>
|
210
|
+
|
211
|
+
|
212
|
+
</ul>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
<h2>
|
219
|
+
Instance Method Summary
|
220
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
221
|
+
</h2>
|
222
|
+
|
223
|
+
<ul class="summary">
|
224
|
+
|
225
|
+
<li class="public ">
|
226
|
+
<span class="summary_signature">
|
227
|
+
|
228
|
+
<a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(population) ⇒ Evolvable::Population </a>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
</span>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<span class="summary_desc"><div class='inline'><p>Executes the evolution process on the population.</p>
|
243
|
+
</div></span>
|
244
|
+
|
245
|
+
</li>
|
246
|
+
|
247
|
+
|
248
|
+
<li class="public ">
|
249
|
+
<span class="summary_signature">
|
250
|
+
|
251
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(selection: Selection.new, combination: GeneCombination.new, mutation: Mutation.new) ⇒ Evolution </a>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</span>
|
256
|
+
|
257
|
+
|
258
|
+
<span class="note title constructor">constructor</span>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<span class="summary_desc"><div class='inline'><p>Initializes a new evolution object.</p>
|
268
|
+
</div></span>
|
269
|
+
|
270
|
+
</li>
|
271
|
+
|
272
|
+
|
273
|
+
</ul>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<div id="constructor_details" class="method_details_list">
|
278
|
+
<h2>Constructor Details</h2>
|
279
|
+
|
280
|
+
<div class="method_details first">
|
281
|
+
<h3 class="signature first" id="initialize-instance_method">
|
282
|
+
|
283
|
+
#<strong>initialize</strong>(selection: Selection.new, combination: GeneCombination.new, mutation: Mutation.new) ⇒ <tt><span class='object_link'><a href="" title="Evolvable::Evolution (class)">Evolution</a></span></tt>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</h3><div class="docstring">
|
290
|
+
<div class="discussion">
|
291
|
+
<p>Initializes a new evolution object.</p>
|
292
|
+
|
293
|
+
|
294
|
+
</div>
|
295
|
+
</div>
|
296
|
+
<div class="tags">
|
297
|
+
<p class="tag_title">Parameters:</p>
|
298
|
+
<ul class="param">
|
299
|
+
|
300
|
+
<li>
|
301
|
+
|
302
|
+
<span class='name'>selection</span>
|
303
|
+
|
304
|
+
|
305
|
+
<span class='type'>(<tt><span class='object_link'><a href="Selection.html" title="Evolvable::Selection (class)">Evolvable::Selection</a></span></tt>, <tt>Hash</tt>)</span>
|
306
|
+
|
307
|
+
|
308
|
+
<em class="default">(defaults to: <tt>Selection.new</tt>)</em>
|
309
|
+
|
310
|
+
|
311
|
+
—
|
312
|
+
<div class='inline'><p>The selection strategy</p>
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</li>
|
316
|
+
|
317
|
+
<li>
|
318
|
+
|
319
|
+
<span class='name'>combination</span>
|
320
|
+
|
321
|
+
|
322
|
+
<span class='type'>(<tt>Evolvable::Combination</tt>, <tt>Hash</tt>)</span>
|
323
|
+
|
324
|
+
|
325
|
+
<em class="default">(defaults to: <tt>GeneCombination.new</tt>)</em>
|
326
|
+
|
327
|
+
|
328
|
+
—
|
329
|
+
<div class='inline'><p>The combination strategy</p>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
<li>
|
335
|
+
|
336
|
+
<span class='name'>mutation</span>
|
337
|
+
|
338
|
+
|
339
|
+
<span class='type'>(<tt><span class='object_link'><a href="Mutation.html" title="Evolvable::Mutation (class)">Evolvable::Mutation</a></span></tt>, <tt>Hash</tt>)</span>
|
340
|
+
|
341
|
+
|
342
|
+
<em class="default">(defaults to: <tt>Mutation.new</tt>)</em>
|
343
|
+
|
344
|
+
|
345
|
+
—
|
346
|
+
<div class='inline'><p>The mutation strategy</p>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</li>
|
350
|
+
|
351
|
+
</ul>
|
352
|
+
|
353
|
+
|
354
|
+
</div><table class="source_code">
|
355
|
+
<tr>
|
356
|
+
<td>
|
357
|
+
<pre class="lines">
|
358
|
+
|
359
|
+
|
360
|
+
25
|
361
|
+
26
|
362
|
+
27
|
363
|
+
28
|
364
|
+
29
|
365
|
+
30
|
366
|
+
31</pre>
|
367
|
+
</td>
|
368
|
+
<td>
|
369
|
+
<pre class="code"><span class="info file"># File 'lib/evolvable/evolution.rb', line 25</span>
|
370
|
+
|
371
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>selection:</span> <span class='const'><span class='object_link'><a href="Selection.html" title="Evolvable::Selection (class)">Selection</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Selection.html#initialize-instance_method" title="Evolvable::Selection#initialize (method)">new</a></span></span><span class='comma'>,</span>
|
372
|
+
<span class='label'>combination:</span> <span class='const'><span class='object_link'><a href="GeneCombination.html" title="Evolvable::GeneCombination (class)">GeneCombination</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span>
|
373
|
+
<span class='label'>mutation:</span> <span class='const'><span class='object_link'><a href="Mutation.html" title="Evolvable::Mutation (class)">Mutation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Mutation.html#initialize-instance_method" title="Evolvable::Mutation#initialize (method)">new</a></span></span><span class='rparen'>)</span>
|
374
|
+
<span class='ivar'>@selection</span> <span class='op'>=</span> <span class='id identifier rubyid_selection'>selection</span>
|
375
|
+
<span class='ivar'>@combination</span> <span class='op'>=</span> <span class='id identifier rubyid_combination'>combination</span>
|
376
|
+
<span class='ivar'>@mutation</span> <span class='op'>=</span> <span class='id identifier rubyid_mutation'>mutation</span>
|
377
|
+
<span class='kw'>end</span></pre>
|
378
|
+
</td>
|
379
|
+
</tr>
|
380
|
+
</table>
|
381
|
+
</div>
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
<div id="instance_attr_details" class="attr_details">
|
386
|
+
<h2>Instance Attribute Details</h2>
|
387
|
+
|
388
|
+
|
389
|
+
<span id="combination=-instance_method"></span>
|
390
|
+
<div class="method_details first">
|
391
|
+
<h3 class="signature first" id="combination-instance_method">
|
392
|
+
|
393
|
+
#<strong>combination</strong> ⇒ <tt>Object</tt>
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
</h3><div class="docstring">
|
400
|
+
<div class="discussion">
|
401
|
+
<p>Returns the value of attribute combination.</p>
|
402
|
+
|
403
|
+
|
404
|
+
</div>
|
405
|
+
</div>
|
406
|
+
<div class="tags">
|
407
|
+
|
408
|
+
|
409
|
+
</div><table class="source_code">
|
410
|
+
<tr>
|
411
|
+
<td>
|
412
|
+
<pre class="lines">
|
413
|
+
|
414
|
+
|
415
|
+
33
|
416
|
+
34
|
417
|
+
35</pre>
|
418
|
+
</td>
|
419
|
+
<td>
|
420
|
+
<pre class="code"><span class="info file"># File 'lib/evolvable/evolution.rb', line 33</span>
|
421
|
+
|
422
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_combination'>combination</span>
|
423
|
+
<span class='ivar'>@combination</span>
|
424
|
+
<span class='kw'>end</span></pre>
|
425
|
+
</td>
|
426
|
+
</tr>
|
427
|
+
</table>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
|
431
|
+
<span id="mutation=-instance_method"></span>
|
432
|
+
<div class="method_details ">
|
433
|
+
<h3 class="signature " id="mutation-instance_method">
|
434
|
+
|
435
|
+
#<strong>mutation</strong> ⇒ <tt>Object</tt>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
</h3><div class="docstring">
|
442
|
+
<div class="discussion">
|
443
|
+
<p>Returns the value of attribute mutation.</p>
|
444
|
+
|
445
|
+
|
446
|
+
</div>
|
447
|
+
</div>
|
448
|
+
<div class="tags">
|
449
|
+
|
450
|
+
|
451
|
+
</div><table class="source_code">
|
452
|
+
<tr>
|
453
|
+
<td>
|
454
|
+
<pre class="lines">
|
455
|
+
|
456
|
+
|
457
|
+
33
|
458
|
+
34
|
459
|
+
35</pre>
|
460
|
+
</td>
|
461
|
+
<td>
|
462
|
+
<pre class="code"><span class="info file"># File 'lib/evolvable/evolution.rb', line 33</span>
|
463
|
+
|
464
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mutation'>mutation</span>
|
465
|
+
<span class='ivar'>@mutation</span>
|
466
|
+
<span class='kw'>end</span></pre>
|
467
|
+
</td>
|
468
|
+
</tr>
|
469
|
+
</table>
|
470
|
+
</div>
|
471
|
+
|
472
|
+
|
473
|
+
<span id="selection=-instance_method"></span>
|
474
|
+
<div class="method_details ">
|
475
|
+
<h3 class="signature " id="selection-instance_method">
|
476
|
+
|
477
|
+
#<strong>selection</strong> ⇒ <tt>Object</tt>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
</h3><div class="docstring">
|
484
|
+
<div class="discussion">
|
485
|
+
<p>Returns the value of attribute selection.</p>
|
486
|
+
|
487
|
+
|
488
|
+
</div>
|
489
|
+
</div>
|
490
|
+
<div class="tags">
|
491
|
+
|
492
|
+
|
493
|
+
</div><table class="source_code">
|
494
|
+
<tr>
|
495
|
+
<td>
|
496
|
+
<pre class="lines">
|
497
|
+
|
498
|
+
|
499
|
+
33
|
500
|
+
34
|
501
|
+
35</pre>
|
502
|
+
</td>
|
503
|
+
<td>
|
504
|
+
<pre class="code"><span class="info file"># File 'lib/evolvable/evolution.rb', line 33</span>
|
505
|
+
|
506
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_selection'>selection</span>
|
507
|
+
<span class='ivar'>@selection</span>
|
508
|
+
<span class='kw'>end</span></pre>
|
509
|
+
</td>
|
510
|
+
</tr>
|
511
|
+
</table>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
</div>
|
515
|
+
|
516
|
+
|
517
|
+
<div id="instance_method_details" class="method_details_list">
|
518
|
+
<h2>Instance Method Details</h2>
|
519
|
+
|
520
|
+
|
521
|
+
<div class="method_details first">
|
522
|
+
<h3 class="signature first" id="call-instance_method">
|
523
|
+
|
524
|
+
#<strong>call</strong>(population) ⇒ <tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
</h3><div class="docstring">
|
531
|
+
<div class="discussion">
|
532
|
+
<p>Executes the evolution process on the population.
|
533
|
+
Applies selection, combination, and mutation in sequence.</p>
|
534
|
+
|
535
|
+
|
536
|
+
</div>
|
537
|
+
</div>
|
538
|
+
<div class="tags">
|
539
|
+
<p class="tag_title">Parameters:</p>
|
540
|
+
<ul class="param">
|
541
|
+
|
542
|
+
<li>
|
543
|
+
|
544
|
+
<span class='name'>population</span>
|
545
|
+
|
546
|
+
|
547
|
+
<span class='type'>(<tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>)</span>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
—
|
552
|
+
<div class='inline'><p>The population to evolve</p>
|
553
|
+
</div>
|
554
|
+
|
555
|
+
</li>
|
556
|
+
|
557
|
+
</ul>
|
558
|
+
|
559
|
+
<p class="tag_title">Returns:</p>
|
560
|
+
<ul class="return">
|
561
|
+
|
562
|
+
<li>
|
563
|
+
|
564
|
+
|
565
|
+
<span class='type'>(<tt><span class='object_link'><a href="Population.html" title="Evolvable::Population (class)">Evolvable::Population</a></span></tt>)</span>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
—
|
570
|
+
<div class='inline'><p>The evolved population</p>
|
571
|
+
</div>
|
572
|
+
|
573
|
+
</li>
|
574
|
+
|
575
|
+
</ul>
|
576
|
+
|
577
|
+
</div><table class="source_code">
|
578
|
+
<tr>
|
579
|
+
<td>
|
580
|
+
<pre class="lines">
|
581
|
+
|
582
|
+
|
583
|
+
74
|
584
|
+
75
|
585
|
+
76
|
586
|
+
77
|
587
|
+
78
|
588
|
+
79</pre>
|
589
|
+
</td>
|
590
|
+
<td>
|
591
|
+
<pre class="code"><span class="info file"># File 'lib/evolvable/evolution.rb', line 74</span>
|
592
|
+
|
593
|
+
<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>
|
594
|
+
<span class='id identifier rubyid_selection'>selection</span><span class='period'>.</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>
|
595
|
+
<span class='id identifier rubyid_combination'>combination</span><span class='period'>.</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>
|
596
|
+
<span class='id identifier rubyid_mutation'>mutation</span><span class='period'>.</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>
|
597
|
+
<span class='id identifier rubyid_population'>population</span>
|
598
|
+
<span class='kw'>end</span></pre>
|
599
|
+
</td>
|
600
|
+
</tr>
|
601
|
+
</table>
|
602
|
+
</div>
|
603
|
+
|
604
|
+
</div>
|
605
|
+
|
606
|
+
</div>
|
607
|
+
|
608
|
+
<div id="footer">
|
609
|
+
Generated on Sat May 10 18:39:22 2025 by
|
610
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
611
|
+
0.9.37 (ruby-3.4.2).
|
612
|
+
</div>
|
613
|
+
|
614
|
+
</div>
|
615
|
+
</body>
|
616
|
+
</html>
|