rubyneat 0.3.5.alpha.3 → 0.3.5.alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/Gemfile +19 -19
- data/Gemfile.lock +39 -33
- data/README.md +66 -0
- data/Rakefile +19 -2
- data/bin/neat +4 -60
- data/lib/rubyneat/cli.rb +5 -0
- data/lib/rubyneat/cli/generate.rb +131 -0
- data/lib/rubyneat/cli/main.rb +54 -0
- data/lib/rubyneat/cli/templates/generate/Gemfile.tt +17 -0
- data/lib/rubyneat/cli/templates/generate/README.md.tt +1 -0
- data/lib/rubyneat/cli/templates/generate/bin/neat.tt +14 -0
- data/{neater/xor_neat.rb → lib/rubyneat/cli/templates/generate/neater.tt} +7 -22
- data/rubyneat.gemspec +73 -297
- data/rubyneat.gemspec.orig +384 -0
- metadata +76 -292
- data/.idea/.name +0 -1
- data/.idea/.rakeTasks +0 -7
- data/.idea/dictionaries/trader.xml +0 -3
- data/.idea/encodings.xml +0 -5
- data/.idea/misc.xml +0 -5
- data/.idea/modules.xml +0 -9
- data/.idea/rubyneat.iml +0 -198
- data/.idea/runConfigurations/invpend_neat.xml +0 -26
- data/.idea/runConfigurations/sigdebug_neat.xml +0 -24
- data/.idea/runConfigurations/xor_neat.xml +0 -26
- data/.idea/runConfigurations/xordebug_neat.xml +0 -24
- data/.idea/runConfigurations/xorsin_neat.xml +0 -24
- data/.idea/scopes/scope_settings.xml +0 -5
- data/.idea/vcs.xml +0 -7
- data/.idea/workspace.xml +0 -1151
- data/.yardoc/checksums +0 -11
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Guardfile +0 -8
- data/doc/ControllerPoint.html +0 -125
- data/doc/CuteA.html +0 -286
- data/doc/CuteB.html +0 -297
- data/doc/DSL.html +0 -883
- data/doc/NEAT.html +0 -588
- data/doc/NEAT/BasicNeuronTypes.html +0 -136
- data/doc/NEAT/BasicNeuronTypes/BiasNeuron.html +0 -518
- data/doc/NEAT/BasicNeuronTypes/CosineNeuron.html +0 -274
- data/doc/NEAT/BasicNeuronTypes/InputNeuron.html +0 -366
- data/doc/NEAT/BasicNeuronTypes/SigmoidNeuron.html +0 -275
- data/doc/NEAT/BasicNeuronTypes/SineNeuron.html +0 -274
- data/doc/NEAT/BasicNeuronTypes/TanhNeuron.html +0 -274
- data/doc/NEAT/Controller.html +0 -2490
- data/doc/NEAT/Controller/NeatSettings.html +0 -3985
- data/doc/NEAT/Critter.html +0 -1037
- data/doc/NEAT/Critter/Genotype.html +0 -1601
- data/doc/NEAT/Critter/Genotype/Gene.html +0 -979
- data/doc/NEAT/Critter/Phenotype.html +0 -603
- data/doc/NEAT/DSL.html +0 -1255
- data/doc/NEAT/Evaluator.html +0 -420
- data/doc/NEAT/Evolver.html +0 -602
- data/doc/NEAT/Evolver/CritterOp.html +0 -551
- data/doc/NEAT/Expressor.html +0 -327
- data/doc/NEAT/Graph.html +0 -402
- data/doc/NEAT/Graph/DependencyResolver.html +0 -478
- data/doc/NEAT/Graph/GraphException.html +0 -123
- data/doc/NEAT/NeatException.html +0 -123
- data/doc/NEAT/NeatOb.html +0 -567
- data/doc/NEAT/Neuron.html +0 -1067
- data/doc/NEAT/Operator.html +0 -162
- data/doc/NEAT/Population.html +0 -1961
- data/doc/NEAT/Trait.html +0 -169
- data/doc/_index.html +0 -373
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file_list.html +0 -53
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -373
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1415
- data/doc/top-level-namespace.html +0 -164
- data/foo/foo_aquarium_example.rb +0 -38
- data/foo/foo_gosu.rb +0 -99
- data/foo/foo_rubygoo.rb +0 -104
- data/foo/foo_sdl.rb +0 -34
- data/foo/icon.png +0 -0
- data/neater/invpend_neat.rb +0 -150
- data/neater/rnlib/inverted_pendulum.rb +0 -380
- data/neater/rnlib/xor.rb +0 -10
- data/neater/sigdebug_neat.rb +0 -136
- data/neater/xoranalog_neat.rb +0 -138
- data/neater/xorsin_neat.rb +0 -143
- data/projectFilesBackup/.idea/rubyneat.iml +0 -180
- data/public/.directory +0 -4
- data/public/background.png +0 -0
- data/public/background.xcf +0 -0
- data/public/cart.png +0 -0
- data/public/cart.xcf +0 -0
- data/public/metalpoles_molton_ball_l.jpg +0 -0
- data/public/old_background.png +0 -0
- data/public/pointer.png +0 -0
- data/public/pointer.xcf +0 -0
- data/public/pole.kra +0 -0
- data/public/pole.png +0 -0
- data/public/pole.xcf +0 -0
- data/public/wheel-of-year-stone-DD-131-WOYS.jpg +0 -0
- data/public/wheel.png +0 -0
- data/public/wheel.xcf +0 -0
- data/public/wood-planks-texture.jpg +0 -0
- data/rdoc/ControllerPoint.html +0 -116
- data/rdoc/CuteA.html +0 -177
- data/rdoc/CuteB.html +0 -178
- data/rdoc/DSLSetup.html +0 -177
- data/rdoc/GameTestWindow.html +0 -242
- data/rdoc/GameWindow.html +0 -292
- data/rdoc/Gemfile.html +0 -215
- data/rdoc/Gemfile_lock.html +0 -327
- data/rdoc/GraphTest.html +0 -210
- data/rdoc/Guardfile.html +0 -198
- data/rdoc/InvertedPendulum.html +0 -198
- data/rdoc/InvertedPendulum/Cart.html +0 -668
- data/rdoc/InvertedPendulum/DSL.html +0 -259
- data/rdoc/InvertedPendulum/InvPendWindow.html +0 -402
- data/rdoc/Logger.html +0 -98
- data/rdoc/NEAT.html +0 -422
- data/rdoc/NEAT/BasicNeuronTypes.html +0 -107
- data/rdoc/NEAT/BasicNeuronTypes/BiasNeuron.html +0 -265
- data/rdoc/NEAT/BasicNeuronTypes/CosineNeuron.html +0 -162
- data/rdoc/NEAT/BasicNeuronTypes/InputNeuron.html +0 -206
- data/rdoc/NEAT/BasicNeuronTypes/SigmoidNeuron.html +0 -162
- data/rdoc/NEAT/BasicNeuronTypes/SineNeuron.html +0 -162
- data/rdoc/NEAT/BasicNeuronTypes/TanhNeuron.html +0 -161
- data/rdoc/NEAT/Controller.html +0 -729
- data/rdoc/NEAT/Controller/NeatSettings.html +0 -880
- data/rdoc/NEAT/Critter.html +0 -489
- data/rdoc/NEAT/Critter/Genotype.html +0 -735
- data/rdoc/NEAT/Critter/Genotype/Gene.html +0 -457
- data/rdoc/NEAT/Critter/Phenotype.html +0 -330
- data/rdoc/NEAT/DSL.html +0 -729
- data/rdoc/NEAT/Evaluator.html +0 -256
- data/rdoc/NEAT/Evolver.html +0 -891
- data/rdoc/NEAT/Evolver/CritterOp.html +0 -349
- data/rdoc/NEAT/Expressor.html +0 -402
- data/rdoc/NEAT/Graph.html +0 -263
- data/rdoc/NEAT/Graph/DependencyResolver.html +0 -291
- data/rdoc/NEAT/Graph/GraphException.html +0 -105
- data/rdoc/NEAT/NeatException.html +0 -105
- data/rdoc/NEAT/NeatOb.html +0 -325
- data/rdoc/NEAT/Neuron.html +0 -481
- data/rdoc/NEAT/Operator.html +0 -109
- data/rdoc/NEAT/Population.html +0 -935
- data/rdoc/NEAT/Trait.html +0 -117
- data/rdoc/Object.html +0 -384
- data/rdoc/Phi.html +0 -98
- data/rdoc/Player.html +0 -383
- data/rdoc/Rakefile.html +0 -254
- data/rdoc/RubyNEAT.html +0 -98
- data/rdoc/RubyNEAT/Application.html +0 -105
- data/rdoc/SDL.html +0 -98
- data/rdoc/SDL/Event2.html +0 -98
- data/rdoc/Vector.html +0 -195
- data/rdoc/created.rid +0 -125
- data/rdoc/doc/ControllerPoint_html.html +0 -299
- data/rdoc/doc/CuteA_html.html +0 -438
- data/rdoc/doc/CuteB_html.html +0 -436
- data/rdoc/doc/DSL_html.html +0 -992
- data/rdoc/doc/NEAT/BasicNeuronTypes/BiasNeuron_html.html +0 -617
- data/rdoc/doc/NEAT/BasicNeuronTypes/CosineNeuron_html.html +0 -413
- data/rdoc/doc/NEAT/BasicNeuronTypes/InputNeuron_html.html +0 -498
- data/rdoc/doc/NEAT/BasicNeuronTypes/SigmoidNeuron_html.html +0 -413
- data/rdoc/doc/NEAT/BasicNeuronTypes/SineNeuron_html.html +0 -413
- data/rdoc/doc/NEAT/BasicNeuronTypes/TanhNeuron_html.html +0 -412
- data/rdoc/doc/NEAT/BasicNeuronTypes_html.html +0 -310
- data/rdoc/doc/NEAT/Controller/NeatSettings_html.html +0 -3324
- data/rdoc/doc/NEAT/Controller_html.html +0 -2212
- data/rdoc/doc/NEAT/Critter/Genotype/Gene_html.html +0 -997
- data/rdoc/doc/NEAT/Critter/Genotype_html.html +0 -1556
- data/rdoc/doc/NEAT/Critter/Phenotype_html.html +0 -687
- data/rdoc/doc/NEAT/Critter_html.html +0 -1037
- data/rdoc/doc/NEAT/DSL_html.html +0 -1349
- data/rdoc/doc/NEAT/Evaluator_html.html +0 -556
- data/rdoc/doc/NEAT/Evolver/CritterOp_html.html +0 -690
- data/rdoc/doc/NEAT/Evolver_html.html +0 -677
- data/rdoc/doc/NEAT/Expressor_html.html +0 -468
- data/rdoc/doc/NEAT/Graph/DependencyResolver_html.html +0 -598
- data/rdoc/doc/NEAT/Graph/GraphException_html.html +0 -299
- data/rdoc/doc/NEAT/Graph_html.html +0 -527
- data/rdoc/doc/NEAT/NeatException_html.html +0 -299
- data/rdoc/doc/NEAT/NeatOb_html.html +0 -671
- data/rdoc/doc/NEAT/Neuron_html.html +0 -1095
- data/rdoc/doc/NEAT/Operator_html.html +0 -337
- data/rdoc/doc/NEAT/Population_html.html +0 -1795
- data/rdoc/doc/NEAT/Trait_html.html +0 -344
- data/rdoc/doc/NEAT_html.html +0 -736
- data/rdoc/doc/_index_html.html +0 -559
- data/rdoc/doc/class_list_html.html +0 -369
- data/rdoc/doc/css/common_css.html +0 -188
- data/rdoc/doc/css/full_list_css.html +0 -243
- data/rdoc/doc/css/style_css.html +0 -530
- data/rdoc/doc/file_list_html.html +0 -240
- data/rdoc/doc/frames_html.html +0 -217
- data/rdoc/doc/index_html.html +0 -559
- data/rdoc/doc/js/app_js.html +0 -423
- data/rdoc/doc/js/full_list_js.html +0 -372
- data/rdoc/doc/js/jquery_js.html +0 -1536
- data/rdoc/doc/method_list_html.html +0 -1375
- data/rdoc/doc/top-level-namespace_html.html +0 -317
- data/rdoc/fonts.css +0 -167
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +0 -282
- data/rdoc/js/darkfish.js +0 -140
- data/rdoc/js/jquery.js +0 -18
- data/rdoc/js/navigation.js +0 -142
- data/rdoc/js/search.js +0 -109
- data/rdoc/js/search_index.js +0 -1
- data/rdoc/js/searcher.js +0 -228
- data/rdoc/rdoc.css +0 -580
- data/rdoc/rubyneat_gemspec.html +0 -387
- data/rdoc/table_of_contents.html +0 -2502
- data/rdoc/xordebug_log.html +0 -170598
- data/rdoc/xorsin_log.html +0 -22569
@@ -1,337 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>Operator.html - rubyneat 0.3.4</title>
|
8
|
-
|
9
|
-
<link href="../../fonts.css" rel="stylesheet">
|
10
|
-
<link href="../../rdoc.css" rel="stylesheet">
|
11
|
-
|
12
|
-
<script type="text/javascript">
|
13
|
-
var rdoc_rel_prefix = "../../";
|
14
|
-
</script>
|
15
|
-
|
16
|
-
<script src="../../js/jquery.js"></script>
|
17
|
-
<script src="../../js/navigation.js"></script>
|
18
|
-
<script src="../../js/search_index.js"></script>
|
19
|
-
<script src="../../js/search.js"></script>
|
20
|
-
<script src="../../js/searcher.js"></script>
|
21
|
-
<script src="../../js/darkfish.js"></script>
|
22
|
-
|
23
|
-
|
24
|
-
<body id="top" role="document" class="file">
|
25
|
-
<nav role="navigation">
|
26
|
-
<div id="project-navigation">
|
27
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
-
<h2>
|
29
|
-
<a href="../../index.html" rel="home">Home</a>
|
30
|
-
</h2>
|
31
|
-
|
32
|
-
<div id="table-of-contents-navigation">
|
33
|
-
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
-
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
-
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
-
<form action="#" method="get" accept-charset="utf-8">
|
41
|
-
<div id="search-field-wrapper">
|
42
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
-
aria-autocomplete="list" aria-controls="search-results"
|
44
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<ul id="search-results" aria-label="Search Results"
|
49
|
-
aria-busy="false" aria-expanded="false"
|
50
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
-
</form>
|
52
|
-
</div>
|
53
|
-
|
54
|
-
</div>
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<div id="project-metadata">
|
59
|
-
<div id="fileindex-section" class="nav-section">
|
60
|
-
<h3>Pages</h3>
|
61
|
-
|
62
|
-
<ul class="link-list">
|
63
|
-
|
64
|
-
<li><a href="../../Gemfile.html">Gemfile</a>
|
65
|
-
|
66
|
-
<li><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
67
|
-
|
68
|
-
<li><a href="../../Guardfile.html">Guardfile</a>
|
69
|
-
|
70
|
-
<li><a href="../../Rakefile.html">Rakefile</a>
|
71
|
-
|
72
|
-
<li><a href="../../doc/ControllerPoint_html.html">ControllerPoint.html</a>
|
73
|
-
|
74
|
-
<li><a href="../../doc/CuteA_html.html">CuteA.html</a>
|
75
|
-
|
76
|
-
<li><a href="../../doc/CuteB_html.html">CuteB.html</a>
|
77
|
-
|
78
|
-
<li><a href="../../doc/DSL_html.html">DSL.html</a>
|
79
|
-
|
80
|
-
<li><a href="../../doc/NEAT_html.html">NEAT.html</a>
|
81
|
-
|
82
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes_html.html">BasicNeuronTypes.html</a>
|
83
|
-
|
84
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/BiasNeuron_html.html">BiasNeuron.html</a>
|
85
|
-
|
86
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/CosineNeuron_html.html">CosineNeuron.html</a>
|
87
|
-
|
88
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/InputNeuron_html.html">InputNeuron.html</a>
|
89
|
-
|
90
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/SigmoidNeuron_html.html">SigmoidNeuron.html</a>
|
91
|
-
|
92
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/SineNeuron_html.html">SineNeuron.html</a>
|
93
|
-
|
94
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/TanhNeuron_html.html">TanhNeuron.html</a>
|
95
|
-
|
96
|
-
<li><a href="../../doc/NEAT/Controller_html.html">Controller.html</a>
|
97
|
-
|
98
|
-
<li><a href="../../doc/NEAT/Controller/NeatSettings_html.html">NeatSettings.html</a>
|
99
|
-
|
100
|
-
<li><a href="../../doc/NEAT/Critter_html.html">Critter.html</a>
|
101
|
-
|
102
|
-
<li><a href="../../doc/NEAT/Critter/Genotype_html.html">Genotype.html</a>
|
103
|
-
|
104
|
-
<li><a href="../../doc/NEAT/Critter/Genotype/Gene_html.html">Gene.html</a>
|
105
|
-
|
106
|
-
<li><a href="../../doc/NEAT/Critter/Phenotype_html.html">Phenotype.html</a>
|
107
|
-
|
108
|
-
<li><a href="../../doc/NEAT/DSL_html.html">DSL.html</a>
|
109
|
-
|
110
|
-
<li><a href="../../doc/NEAT/Evaluator_html.html">Evaluator.html</a>
|
111
|
-
|
112
|
-
<li><a href="../../doc/NEAT/Evolver_html.html">Evolver.html</a>
|
113
|
-
|
114
|
-
<li><a href="../../doc/NEAT/Evolver/CritterOp_html.html">CritterOp.html</a>
|
115
|
-
|
116
|
-
<li><a href="../../doc/NEAT/Expressor_html.html">Expressor.html</a>
|
117
|
-
|
118
|
-
<li><a href="../../doc/NEAT/Graph_html.html">Graph.html</a>
|
119
|
-
|
120
|
-
<li><a href="../../doc/NEAT/Graph/DependencyResolver_html.html">DependencyResolver.html</a>
|
121
|
-
|
122
|
-
<li><a href="../../doc/NEAT/Graph/GraphException_html.html">GraphException.html</a>
|
123
|
-
|
124
|
-
<li><a href="../../doc/NEAT/NeatException_html.html">NeatException.html</a>
|
125
|
-
|
126
|
-
<li><a href="../../doc/NEAT/NeatOb_html.html">NeatOb.html</a>
|
127
|
-
|
128
|
-
<li><a href="../../doc/NEAT/Neuron_html.html">Neuron.html</a>
|
129
|
-
|
130
|
-
<li><a href="../../doc/NEAT/Operator_html.html">Operator.html</a>
|
131
|
-
|
132
|
-
<li><a href="../../doc/NEAT/Population_html.html">Population.html</a>
|
133
|
-
|
134
|
-
<li><a href="../../doc/NEAT/Trait_html.html">Trait.html</a>
|
135
|
-
|
136
|
-
<li><a href="../../doc/_index_html.html">_index.html</a>
|
137
|
-
|
138
|
-
<li><a href="../../doc/class_list_html.html">class_list.html</a>
|
139
|
-
|
140
|
-
<li><a href="../../doc/css/common_css.html">common.css</a>
|
141
|
-
|
142
|
-
<li><a href="../../doc/css/full_list_css.html">full_list.css</a>
|
143
|
-
|
144
|
-
<li><a href="../../doc/css/style_css.html">style.css</a>
|
145
|
-
|
146
|
-
<li><a href="../../doc/file_list_html.html">file_list.html</a>
|
147
|
-
|
148
|
-
<li><a href="../../doc/frames_html.html">frames.html</a>
|
149
|
-
|
150
|
-
<li><a href="../../doc/index_html.html">index.html</a>
|
151
|
-
|
152
|
-
<li><a href="../../doc/js/app_js.html">app.js</a>
|
153
|
-
|
154
|
-
<li><a href="../../doc/js/full_list_js.html">full_list.js</a>
|
155
|
-
|
156
|
-
<li><a href="../../doc/js/jquery_js.html">jquery.js</a>
|
157
|
-
|
158
|
-
<li><a href="../../doc/method_list_html.html">method_list.html</a>
|
159
|
-
|
160
|
-
<li><a href="../../doc/top-level-namespace_html.html">top-level-namespace.html</a>
|
161
|
-
|
162
|
-
<li><a href="../../foo_dump_log.html">foo.dump.log</a>
|
163
|
-
|
164
|
-
<li><a href="../../rubyneat_gemspec.html">rubyneat.gemspec</a>
|
165
|
-
|
166
|
-
<li><a href="../../xordebug_log.html">xordebug.log</a>
|
167
|
-
|
168
|
-
<li><a href="../../xorsin_log.html">xorsin.log</a>
|
169
|
-
|
170
|
-
</ul>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
</div>
|
174
|
-
</nav>
|
175
|
-
|
176
|
-
<main role="main" aria-label="Page doc/NEAT/Operator.html">
|
177
|
-
|
178
|
-
<p><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”</p>
|
179
|
-
|
180
|
-
<pre>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></pre>
|
181
|
-
|
182
|
-
<p><html xmlns=“<a
|
183
|
-
href="http://www.w3.org/1999/xhtml">www.w3.org/1999/xhtml</a>”
|
184
|
-
xml:lang=“en” lang=“en”></p>
|
185
|
-
|
186
|
-
<pre><head>
|
187
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></pre>
|
188
|
-
|
189
|
-
<p><title></p>
|
190
|
-
|
191
|
-
<pre>Class: NEAT::Operator
|
192
|
-
|
193
|
-
&mdash; Documentation by YARD 0.8.7.3</pre>
|
194
|
-
|
195
|
-
<p></title></p>
|
196
|
-
|
197
|
-
<pre><link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
198
|
-
|
199
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" /></pre>
|
200
|
-
|
201
|
-
<p><script type=“text/javascript” charset=“utf-8”></p>
|
202
|
-
|
203
|
-
<pre>hasFrames = window.top.frames.main ? true : false;
|
204
|
-
relpath = '../';
|
205
|
-
framesUrl = "../frames.html#!" + escape(window.location.href);</pre>
|
206
|
-
|
207
|
-
<p></script></p>
|
208
|
-
|
209
|
-
<pre><script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
210
|
-
|
211
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
212
|
-
|
213
|
-
</head>
|
214
|
-
<body>
|
215
|
-
<div id="header">
|
216
|
-
<div id="menu">
|
217
|
-
|
218
|
-
<a href="../_index.html">Index (O)</a> &raquo;
|
219
|
-
<span class='title'><span class='object_link'><a href="../NEAT.html" title="NEAT (module)">NEAT</a></span></span>
|
220
|
-
&raquo;
|
221
|
-
<span class="title">Operator</span>
|
222
|
-
|
223
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div></pre>
|
224
|
-
|
225
|
-
<p></div></p>
|
226
|
-
|
227
|
-
<pre> <div id="search">
|
228
|
-
|
229
|
-
<a class="full_list_link" id="class_list_link"
|
230
|
-
href="../class_list.html">
|
231
|
-
Class List
|
232
|
-
</a>
|
233
|
-
|
234
|
-
<a class="full_list_link" id="method_list_link"
|
235
|
-
href="../method_list.html">
|
236
|
-
Method List
|
237
|
-
</a>
|
238
|
-
|
239
|
-
<a class="full_list_link" id="file_list_link"
|
240
|
-
href="../file_list.html">
|
241
|
-
File List
|
242
|
-
</a></pre>
|
243
|
-
|
244
|
-
<p></div></p>
|
245
|
-
|
246
|
-
<pre> <div class="clear"></div>
|
247
|
-
</div>
|
248
|
-
|
249
|
-
<iframe id="search_frame"></iframe>
|
250
|
-
|
251
|
-
<div id="content"><h1>Class: NEAT::Operator</pre>
|
252
|
-
|
253
|
-
<p></h1></p>
|
254
|
-
|
255
|
-
<p><dl class=“box”></p>
|
256
|
-
|
257
|
-
<pre><dt class="r1">Inherits:</dt>
|
258
|
-
<dd class="r1">
|
259
|
-
<span class="inheritName"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></span>
|
260
|
-
|
261
|
-
<ul class="fullTree">
|
262
|
-
<li>Object</li>
|
263
|
-
|
264
|
-
<li class="next"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></li>
|
265
|
-
|
266
|
-
<li class="next">NEAT::Operator</li>
|
267
|
-
|
268
|
-
</ul>
|
269
|
-
<a href="#" class="inheritanceTree">show all</a>
|
270
|
-
|
271
|
-
</dd>
|
272
|
-
|
273
|
-
<dt class="r2 last">Defined in:</dt>
|
274
|
-
<dd class="r2 last">lib/rubyneat/rubyneat.rb</dd></pre>
|
275
|
-
|
276
|
-
<p></dl> <div class=“clear”></div></p>
|
277
|
-
|
278
|
-
<p><h2>Overview</h2><div class=“docstring”></p>
|
279
|
-
|
280
|
-
<pre><div class="discussion"></pre>
|
281
|
-
|
282
|
-
<p><h1 id=“label-Base+class+of+operators+in+RubyNEAT%2C”>Base class of
|
283
|
-
operators in <a href="../../RubyNEAT.html">RubyNEAT</a>,</h1></p>
|
284
|
-
|
285
|
-
<p><p>Such as Evolver, etc.</p></p>
|
286
|
-
|
287
|
-
<pre></div></pre>
|
288
|
-
|
289
|
-
<p></div> <div class=“tags”></p>
|
290
|
-
|
291
|
-
<p></div><div id=“subclasses”></p>
|
292
|
-
|
293
|
-
<pre><h2>Direct Known Subclasses</h2>
|
294
|
-
<p class="children"><span class='object_link'><a href="Evaluator.html" title="NEAT::Evaluator (class)">Evaluator</a></span>, <span class='object_link'><a href="Evolver.html" title="NEAT::Evolver (class)">Evolver</a></span>, <span class='object_link'><a href="Expressor.html" title="NEAT::Expressor (class)">Expressor</a></span></p></pre>
|
295
|
-
|
296
|
-
<p></div></p>
|
297
|
-
|
298
|
-
<pre class="ruby"><span class="ruby-operator"><</span><span class="ruby-identifier">h2</span><span class="ruby-operator">></span><span class="ruby-constant">Instance</span> <span class="ruby-constant">Attribute</span> <span class="ruby-constant">Summary</span><span class="ruby-operator"><</span><span class="ruby-regexp">/h2>
|
299
|
-
|
300
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span></</span><span class="ruby-identifier">h3</span><span class="ruby-operator">></span>
|
301
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">p</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"inherited"</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'object_link'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"NeatOb.html#controller-instance_method"</span> <span class="ruby-identifier">title</span>=<span class="ruby-node">"NEAT::NeatOb#controller (method)"</span><span class="ruby-operator">></span><span class="ruby-comment">#controller</a></span>, <span class='object_link'><a href="NeatOb.html#name-instance_method" title="NEAT::NeatOb#name (method)">#name</a></span></p></span>
|
302
|
-
|
303
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">h2</span><span class="ruby-operator">></span><span class="ruby-constant">Method</span> <span class="ruby-constant">Summary</span><span class="ruby-operator"><</span><span class="ruby-regexp">/h2>
|
304
|
-
|
305
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span></</span><span class="ruby-identifier">h3</span><span class="ruby-operator">></span>
|
306
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">p</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"inherited"</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'object_link'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"NeatOb.html#initialize-instance_method"</span> <span class="ruby-identifier">title</span>=<span class="ruby-node">"NEAT::NeatOb#initialize (method)"</span><span class="ruby-operator">></span><span class="ruby-comment">#initialize</a></span>, <span class='object_link'><a href="NeatOb.html#log-instance_method" title="NEAT::NeatOb#log (method)">#log</a></span>, <span class='object_link'><a href="NeatOb.html#log-class_method" title="NEAT::NeatOb.log (method)">log</a></span>, <span class='object_link'><a href="NeatOb.html#to_s-instance_method" title="NEAT::NeatOb#to_s (method)">#to_s</a></span></p></span>
|
307
|
-
|
308
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">div</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">"constructor_details"</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"method_details_list"</span><span class="ruby-operator">></span>
|
309
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">h2</span><span class="ruby-operator">></span><span class="ruby-constant">Constructor</span> <span class="ruby-constant">Details</span><span class="ruby-operator"><</span><span class="ruby-node">/h2>
|
310
|
-
|
311
|
-
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="NeatOb.html#initialize-instance_method" title="NEAT::NeatOb#initialize (method)">NEAT::NeatOb</</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span></</span><span class="ruby-identifier">p</span><span class="ruby-operator">></span>
|
312
|
-
</pre>
|
313
|
-
|
314
|
-
<p></div></p>
|
315
|
-
|
316
|
-
<p></div></p>
|
317
|
-
|
318
|
-
<pre> <div id="footer">
|
319
|
-
Generated on Sun Mar 16 16:36:52 2014 by
|
320
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
321
|
-
0.8.7.3 (ruby-2.1.1).</pre>
|
322
|
-
|
323
|
-
<p></div></p>
|
324
|
-
|
325
|
-
<pre></body></pre>
|
326
|
-
|
327
|
-
<p></html></p>
|
328
|
-
</main>
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
<footer id="validator-badges" role="contentinfo">
|
333
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
334
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
335
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
336
|
-
</footer>
|
337
|
-
|
@@ -1,1795 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>Population.html - rubyneat 0.3.4</title>
|
8
|
-
|
9
|
-
<link href="../../fonts.css" rel="stylesheet">
|
10
|
-
<link href="../../rdoc.css" rel="stylesheet">
|
11
|
-
|
12
|
-
<script type="text/javascript">
|
13
|
-
var rdoc_rel_prefix = "../../";
|
14
|
-
</script>
|
15
|
-
|
16
|
-
<script src="../../js/jquery.js"></script>
|
17
|
-
<script src="../../js/navigation.js"></script>
|
18
|
-
<script src="../../js/search_index.js"></script>
|
19
|
-
<script src="../../js/search.js"></script>
|
20
|
-
<script src="../../js/searcher.js"></script>
|
21
|
-
<script src="../../js/darkfish.js"></script>
|
22
|
-
|
23
|
-
|
24
|
-
<body id="top" role="document" class="file">
|
25
|
-
<nav role="navigation">
|
26
|
-
<div id="project-navigation">
|
27
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
-
<h2>
|
29
|
-
<a href="../../index.html" rel="home">Home</a>
|
30
|
-
</h2>
|
31
|
-
|
32
|
-
<div id="table-of-contents-navigation">
|
33
|
-
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
-
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
-
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
-
<form action="#" method="get" accept-charset="utf-8">
|
41
|
-
<div id="search-field-wrapper">
|
42
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
-
aria-autocomplete="list" aria-controls="search-results"
|
44
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<ul id="search-results" aria-label="Search Results"
|
49
|
-
aria-busy="false" aria-expanded="false"
|
50
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
-
</form>
|
52
|
-
</div>
|
53
|
-
|
54
|
-
</div>
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<div id="project-metadata">
|
59
|
-
<div id="fileindex-section" class="nav-section">
|
60
|
-
<h3>Pages</h3>
|
61
|
-
|
62
|
-
<ul class="link-list">
|
63
|
-
|
64
|
-
<li><a href="../../Gemfile.html">Gemfile</a>
|
65
|
-
|
66
|
-
<li><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
67
|
-
|
68
|
-
<li><a href="../../Guardfile.html">Guardfile</a>
|
69
|
-
|
70
|
-
<li><a href="../../Rakefile.html">Rakefile</a>
|
71
|
-
|
72
|
-
<li><a href="../../doc/ControllerPoint_html.html">ControllerPoint.html</a>
|
73
|
-
|
74
|
-
<li><a href="../../doc/CuteA_html.html">CuteA.html</a>
|
75
|
-
|
76
|
-
<li><a href="../../doc/CuteB_html.html">CuteB.html</a>
|
77
|
-
|
78
|
-
<li><a href="../../doc/DSL_html.html">DSL.html</a>
|
79
|
-
|
80
|
-
<li><a href="../../doc/NEAT_html.html">NEAT.html</a>
|
81
|
-
|
82
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes_html.html">BasicNeuronTypes.html</a>
|
83
|
-
|
84
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/BiasNeuron_html.html">BiasNeuron.html</a>
|
85
|
-
|
86
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/CosineNeuron_html.html">CosineNeuron.html</a>
|
87
|
-
|
88
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/InputNeuron_html.html">InputNeuron.html</a>
|
89
|
-
|
90
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/SigmoidNeuron_html.html">SigmoidNeuron.html</a>
|
91
|
-
|
92
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/SineNeuron_html.html">SineNeuron.html</a>
|
93
|
-
|
94
|
-
<li><a href="../../doc/NEAT/BasicNeuronTypes/TanhNeuron_html.html">TanhNeuron.html</a>
|
95
|
-
|
96
|
-
<li><a href="../../doc/NEAT/Controller_html.html">Controller.html</a>
|
97
|
-
|
98
|
-
<li><a href="../../doc/NEAT/Controller/NeatSettings_html.html">NeatSettings.html</a>
|
99
|
-
|
100
|
-
<li><a href="../../doc/NEAT/Critter_html.html">Critter.html</a>
|
101
|
-
|
102
|
-
<li><a href="../../doc/NEAT/Critter/Genotype_html.html">Genotype.html</a>
|
103
|
-
|
104
|
-
<li><a href="../../doc/NEAT/Critter/Genotype/Gene_html.html">Gene.html</a>
|
105
|
-
|
106
|
-
<li><a href="../../doc/NEAT/Critter/Phenotype_html.html">Phenotype.html</a>
|
107
|
-
|
108
|
-
<li><a href="../../doc/NEAT/DSL_html.html">DSL.html</a>
|
109
|
-
|
110
|
-
<li><a href="../../doc/NEAT/Evaluator_html.html">Evaluator.html</a>
|
111
|
-
|
112
|
-
<li><a href="../../doc/NEAT/Evolver_html.html">Evolver.html</a>
|
113
|
-
|
114
|
-
<li><a href="../../doc/NEAT/Evolver/CritterOp_html.html">CritterOp.html</a>
|
115
|
-
|
116
|
-
<li><a href="../../doc/NEAT/Expressor_html.html">Expressor.html</a>
|
117
|
-
|
118
|
-
<li><a href="../../doc/NEAT/Graph_html.html">Graph.html</a>
|
119
|
-
|
120
|
-
<li><a href="../../doc/NEAT/Graph/DependencyResolver_html.html">DependencyResolver.html</a>
|
121
|
-
|
122
|
-
<li><a href="../../doc/NEAT/Graph/GraphException_html.html">GraphException.html</a>
|
123
|
-
|
124
|
-
<li><a href="../../doc/NEAT/NeatException_html.html">NeatException.html</a>
|
125
|
-
|
126
|
-
<li><a href="../../doc/NEAT/NeatOb_html.html">NeatOb.html</a>
|
127
|
-
|
128
|
-
<li><a href="../../doc/NEAT/Neuron_html.html">Neuron.html</a>
|
129
|
-
|
130
|
-
<li><a href="../../doc/NEAT/Operator_html.html">Operator.html</a>
|
131
|
-
|
132
|
-
<li><a href="../../doc/NEAT/Population_html.html">Population.html</a>
|
133
|
-
|
134
|
-
<li><a href="../../doc/NEAT/Trait_html.html">Trait.html</a>
|
135
|
-
|
136
|
-
<li><a href="../../doc/_index_html.html">_index.html</a>
|
137
|
-
|
138
|
-
<li><a href="../../doc/class_list_html.html">class_list.html</a>
|
139
|
-
|
140
|
-
<li><a href="../../doc/css/common_css.html">common.css</a>
|
141
|
-
|
142
|
-
<li><a href="../../doc/css/full_list_css.html">full_list.css</a>
|
143
|
-
|
144
|
-
<li><a href="../../doc/css/style_css.html">style.css</a>
|
145
|
-
|
146
|
-
<li><a href="../../doc/file_list_html.html">file_list.html</a>
|
147
|
-
|
148
|
-
<li><a href="../../doc/frames_html.html">frames.html</a>
|
149
|
-
|
150
|
-
<li><a href="../../doc/index_html.html">index.html</a>
|
151
|
-
|
152
|
-
<li><a href="../../doc/js/app_js.html">app.js</a>
|
153
|
-
|
154
|
-
<li><a href="../../doc/js/full_list_js.html">full_list.js</a>
|
155
|
-
|
156
|
-
<li><a href="../../doc/js/jquery_js.html">jquery.js</a>
|
157
|
-
|
158
|
-
<li><a href="../../doc/method_list_html.html">method_list.html</a>
|
159
|
-
|
160
|
-
<li><a href="../../doc/top-level-namespace_html.html">top-level-namespace.html</a>
|
161
|
-
|
162
|
-
<li><a href="../../foo_dump_log.html">foo.dump.log</a>
|
163
|
-
|
164
|
-
<li><a href="../../rubyneat_gemspec.html">rubyneat.gemspec</a>
|
165
|
-
|
166
|
-
<li><a href="../../xordebug_log.html">xordebug.log</a>
|
167
|
-
|
168
|
-
<li><a href="../../xorsin_log.html">xorsin.log</a>
|
169
|
-
|
170
|
-
</ul>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
</div>
|
174
|
-
</nav>
|
175
|
-
|
176
|
-
<main role="main" aria-label="Page doc/NEAT/Population.html">
|
177
|
-
|
178
|
-
<p><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”</p>
|
179
|
-
|
180
|
-
<pre>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></pre>
|
181
|
-
|
182
|
-
<p><html xmlns=“<a
|
183
|
-
href="http://www.w3.org/1999/xhtml">www.w3.org/1999/xhtml</a>”
|
184
|
-
xml:lang=“en” lang=“en”></p>
|
185
|
-
|
186
|
-
<pre><head>
|
187
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></pre>
|
188
|
-
|
189
|
-
<p><title></p>
|
190
|
-
|
191
|
-
<pre>Class: NEAT::Population
|
192
|
-
|
193
|
-
&mdash; Documentation by YARD 0.8.7.3</pre>
|
194
|
-
|
195
|
-
<p></title></p>
|
196
|
-
|
197
|
-
<pre><link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
198
|
-
|
199
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" /></pre>
|
200
|
-
|
201
|
-
<p><script type=“text/javascript” charset=“utf-8”></p>
|
202
|
-
|
203
|
-
<pre>hasFrames = window.top.frames.main ? true : false;
|
204
|
-
relpath = '../';
|
205
|
-
framesUrl = "../frames.html#!" + escape(window.location.href);</pre>
|
206
|
-
|
207
|
-
<p></script></p>
|
208
|
-
|
209
|
-
<pre><script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
210
|
-
|
211
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
212
|
-
|
213
|
-
</head>
|
214
|
-
<body>
|
215
|
-
<div id="header">
|
216
|
-
<div id="menu">
|
217
|
-
|
218
|
-
<a href="../_index.html">Index (P)</a> &raquo;
|
219
|
-
<span class='title'><span class='object_link'><a href="../NEAT.html" title="NEAT (module)">NEAT</a></span></span>
|
220
|
-
&raquo;
|
221
|
-
<span class="title">Population</span>
|
222
|
-
|
223
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div></pre>
|
224
|
-
|
225
|
-
<p></div></p>
|
226
|
-
|
227
|
-
<pre> <div id="search">
|
228
|
-
|
229
|
-
<a class="full_list_link" id="class_list_link"
|
230
|
-
href="../class_list.html">
|
231
|
-
Class List
|
232
|
-
</a>
|
233
|
-
|
234
|
-
<a class="full_list_link" id="method_list_link"
|
235
|
-
href="../method_list.html">
|
236
|
-
Method List
|
237
|
-
</a>
|
238
|
-
|
239
|
-
<a class="full_list_link" id="file_list_link"
|
240
|
-
href="../file_list.html">
|
241
|
-
File List
|
242
|
-
</a></pre>
|
243
|
-
|
244
|
-
<p></div></p>
|
245
|
-
|
246
|
-
<pre> <div class="clear"></div>
|
247
|
-
</div>
|
248
|
-
|
249
|
-
<iframe id="search_frame"></iframe>
|
250
|
-
|
251
|
-
<div id="content"><h1>Class: NEAT::Population</pre>
|
252
|
-
|
253
|
-
<p></h1></p>
|
254
|
-
|
255
|
-
<p><dl class=“box”></p>
|
256
|
-
|
257
|
-
<pre><dt class="r1">Inherits:</dt>
|
258
|
-
<dd class="r1">
|
259
|
-
<span class="inheritName"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></span>
|
260
|
-
|
261
|
-
<ul class="fullTree">
|
262
|
-
<li>Object</li>
|
263
|
-
|
264
|
-
<li class="next"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></li>
|
265
|
-
|
266
|
-
<li class="next">NEAT::Population</li>
|
267
|
-
|
268
|
-
</ul>
|
269
|
-
<a href="#" class="inheritanceTree">show all</a>
|
270
|
-
|
271
|
-
</dd>
|
272
|
-
|
273
|
-
<dt class="r2 last">Defined in:</dt>
|
274
|
-
<dd class="r2 last">lib/rubyneat/population.rb</dd></pre>
|
275
|
-
|
276
|
-
<p></dl> <div class=“clear”></div></p>
|
277
|
-
|
278
|
-
<p><h2>Overview</h2><div class=“docstring”></p>
|
279
|
-
|
280
|
-
<pre><div class="discussion"></pre>
|
281
|
-
|
282
|
-
<p><h1 id=“label-Population+of+NEAT+Critters.”>Population of <a
|
283
|
-
href="../../NEAT.html">NEAT</a> Critters.</h1></p>
|
284
|
-
|
285
|
-
<p><p>The Population In ourselves we have the pool of neurons the
|
286
|
-
critters all use. the pool of neurons are indirects, of course, as during
|
287
|
-
phenotype expression, all the phenotypes shall be created
|
288
|
-
individually.</p></p>
|
289
|
-
|
290
|
-
<pre></div></pre>
|
291
|
-
|
292
|
-
<p></div> <div class=“tags”></p>
|
293
|
-
|
294
|
-
<p></div></p>
|
295
|
-
|
296
|
-
<pre><h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
297
|
-
<ul class="summary">
|
298
|
-
|
299
|
-
<li class="public ">
|
300
|
-
<span class="summary_signature">
|
301
|
-
|
302
|
-
<a href="#critters-instance_method" title="#critters (instance method)">- (Object) <strong>critters</strong> </a>
|
303
|
-
|
304
|
-
</span>
|
305
|
-
|
306
|
-
<span class="summary_desc"><div class='inline'></pre>
|
307
|
-
|
308
|
-
<p><p>list of critter in this population.</p>
|
309
|
-
</div></span></p>
|
310
|
-
|
311
|
-
<p></li></p>
|
312
|
-
|
313
|
-
<pre> <li class="public ">
|
314
|
-
<span class="summary_signature">
|
315
|
-
|
316
|
-
<a href="#fitness-instance_method" title="#fitness (instance method)">- (Object) <strong>fitness</strong> </a>
|
317
|
-
|
318
|
-
</span>
|
319
|
-
|
320
|
-
<span class="note title readonly">readonly</span>
|
321
|
-
|
322
|
-
<span class="summary_desc"><div class='inline'></pre>
|
323
|
-
|
324
|
-
<p><p>Overall population fitness and novelty.</p>
|
325
|
-
</div></span></p>
|
326
|
-
|
327
|
-
<p></li></p>
|
328
|
-
|
329
|
-
<pre> <li class="public ">
|
330
|
-
<span class="summary_signature">
|
331
|
-
|
332
|
-
<a href="#hidden_neurons-instance_method" title="#hidden_neurons (instance method)">- (Object) <strong>hidden_neurons</strong> </a>
|
333
|
-
|
334
|
-
</span>
|
335
|
-
|
336
|
-
<span class="summary_desc"><div class='inline'></pre>
|
337
|
-
|
338
|
-
<p><p>List of possible neuron classes for hidden neurons.</p>
|
339
|
-
</div></span></p>
|
340
|
-
|
341
|
-
<p></li></p>
|
342
|
-
|
343
|
-
<pre> <li class="public ">
|
344
|
-
<span class="summary_signature">
|
345
|
-
|
346
|
-
<a href="#input_neurons-instance_method" title="#input_neurons (instance method)">- (Object) <strong>input_neurons</strong> </a>
|
347
|
-
|
348
|
-
</span>
|
349
|
-
|
350
|
-
<span class="summary_desc"><div class='inline'></pre>
|
351
|
-
|
352
|
-
<p><p>Ordered list or hash of input neuron classes (all critters
|
353
|
-
generated here shall have this).</p> </div></span></p>
|
354
|
-
|
355
|
-
<p></li></p>
|
356
|
-
|
357
|
-
<pre> <li class="public ">
|
358
|
-
<span class="summary_signature">
|
359
|
-
|
360
|
-
<a href="#novelty-instance_method" title="#novelty (instance method)">- (Object) <strong>novelty</strong> </a>
|
361
|
-
|
362
|
-
</span>
|
363
|
-
|
364
|
-
<span class="note title readonly">readonly</span>
|
365
|
-
|
366
|
-
<span class="summary_desc"><div class='inline'></pre>
|
367
|
-
|
368
|
-
<p><p>Overall population fitness and novelty.</p>
|
369
|
-
</div></span></p>
|
370
|
-
|
371
|
-
<p></li></p>
|
372
|
-
|
373
|
-
<pre> <li class="public ">
|
374
|
-
<span class="summary_signature">
|
375
|
-
|
376
|
-
<a href="#output_neurons-instance_method" title="#output_neurons (instance method)">- (Object) <strong>output_neurons</strong> </a>
|
377
|
-
|
378
|
-
</span>
|
379
|
-
|
380
|
-
<span class="summary_desc"><div class='inline'></pre>
|
381
|
-
|
382
|
-
<p><p>Ordered list or hash of output neuron classes (all critters
|
383
|
-
generated here shall have this).</p> </div></span></p>
|
384
|
-
|
385
|
-
<p></li></p>
|
386
|
-
|
387
|
-
<pre> <li class="public ">
|
388
|
-
<span class="summary_signature">
|
389
|
-
|
390
|
-
<a href="#species-instance_method" title="#species (instance method)">- (Object) <strong>species</strong> </a>
|
391
|
-
|
392
|
-
</span>
|
393
|
-
|
394
|
-
<span class="note title readonly">readonly</span>
|
395
|
-
|
396
|
-
<span class="summary_desc"><div class='inline'></pre>
|
397
|
-
|
398
|
-
<p><p>Hash list of species lists.</p> </div></span></p>
|
399
|
-
|
400
|
-
<p></li></p>
|
401
|
-
|
402
|
-
<pre> <li class="public ">
|
403
|
-
<span class="summary_signature">
|
404
|
-
|
405
|
-
<a href="#traits-instance_method" title="#traits (instance method)">- (Object) <strong>traits</strong> </a>
|
406
|
-
|
407
|
-
</span>
|
408
|
-
|
409
|
-
<span class="summary_desc"><div class='inline'></pre>
|
410
|
-
|
411
|
-
<p><p>Returns the value of attribute traits.</p>
|
412
|
-
</div></span></p>
|
413
|
-
|
414
|
-
<p></li></p>
|
415
|
-
|
416
|
-
<pre class="ruby"><span class="ruby-operator"><</span><span class="ruby-regexp">/ul>
|
417
|
-
|
418
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span></</span><span class="ruby-identifier">h3</span><span class="ruby-operator">></span>
|
419
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">p</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"inherited"</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'object_link'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"NeatOb.html#controller-instance_method"</span> <span class="ruby-identifier">title</span>=<span class="ruby-node">"NEAT::NeatOb#controller (method)"</span><span class="ruby-operator">></span><span class="ruby-comment">#controller</a></span>, <span class='object_link'><a href="NeatOb.html#name-instance_method" title="NEAT::NeatOb#name (method)">#name</a></span></p></span>
|
420
|
-
|
421
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">h2</span><span class="ruby-operator">></span>
|
422
|
-
<span class="ruby-constant">Class</span> <span class="ruby-constant">Method</span> <span class="ruby-constant">Summary</span>
|
423
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">small</span><span class="ruby-operator">></span>(<span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"#"</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_toggle"</span><span class="ruby-operator">></span><span class="ruby-identifier">collapse</span><span class="ruby-operator"><</span><span class="ruby-regexp">/a>)</sm</span><span class="ruby-identifier">all</span><span class="ruby-operator">></span>
|
424
|
-
<span class="ruby-operator"><</span><span class="ruby-node">/h2>
|
425
|
-
|
426
|
-
<ul class="summary">
|
427
|
-
|
428
|
-
<li class="public ">
|
429
|
-
<span class="summary_signature">
|
430
|
-
|
431
|
-
<a href="#compactify%21-class_method" title="compactify! (class method)">+ (Object) <strong>compactify!</s</span><span class="ruby-identifier">trong</span><span class="ruby-operator">></span>(<span class="ruby-identifier">parm</span>) <span class="ruby-operator"><</span><span class="ruby-regexp">/a>
|
432
|
-
|
433
|
-
</s</span><span class="ruby-identifier">pan</span><span class="ruby-operator">></span>
|
434
|
-
|
435
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_desc"</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-identifier">div</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">'inline'</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/div></s</span><span class="ruby-identifier">pan</span><span class="ruby-operator">></span>
|
436
|
-
</pre>
|
437
|
-
|
438
|
-
<p></li></p>
|
439
|
-
|
440
|
-
<pre class="ruby"> <span class="ruby-operator"><</span><span class="ruby-identifier">li</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"public "</span><span class="ruby-operator">></span>
|
441
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_signature"</span><span class="ruby-operator">></span>
|
442
|
-
|
443
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"#evaluate%21-class_method"</span> <span class="ruby-identifier">title</span>=<span class="ruby-string">"evaluate! (class method)"</span><span class="ruby-operator">></span><span class="ruby-operator">+</span> (<span class="ruby-constant">Object</span>) <span class="ruby-operator"><</span><span class="ruby-identifier">strong</span><span class="ruby-operator">></span><span class="ruby-identifier">evaluate!</span><span class="ruby-operator"><</span><span class="ruby-regexp">/strong> </</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span>
|
444
|
-
|
445
|
-
<span class="ruby-operator"><</span><span class="ruby-regexp">/span>
|
446
|
-
|
447
|
-
<span class="summary_desc"><div class='inline'></</span><span class="ruby-identifier">div</span><span class="ruby-operator">></span><span class="ruby-operator"><</span><span class="ruby-regexp">/span>
|
448
|
-
</span></pre>
|
449
|
-
|
450
|
-
<p></li></p>
|
451
|
-
|
452
|
-
<pre class="ruby"> <span class="ruby-operator"><</span><span class="ruby-identifier">li</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"public "</span><span class="ruby-operator">></span>
|
453
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">span</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"summary_signature"</span><span class="ruby-operator">></span>
|
454
|
-
|
455
|
-
<span class="ruby-operator"><</span><span class="ruby-identifier">a</span> <span class="ruby-identifier">href</span>=<span class="ruby-node">"#member%3F-class_method"</span> <span class="ruby-identifier">title</span>=<span class="ruby-string">"member? (class method)"</span><span class="ruby-operator">></span><span class="ruby-operator">+</span> (<span class="ruby-constant">Boolean</span>) <span class="ruby-operator"><</span><span class="ruby-identifier">strong</span><span class="ruby-operator">></span><span class="ruby-identifier">member?</span><span class="ruby-operator"><</span><span class="ruby-regexp">/strong>(crit) </</span><span class="ruby-identifier">a</span><span class="ruby-operator">></span>
|
456
|
-
|
457
|
-
<span class="ruby-operator"><</span><span class="ruby-regexp">/span>
|
458
|
-
|
459
|
-
<span class="summary_desc"><div class='inline'>
|
460
|
-
</span></pre>
|
461
|
-
|
462
|
-
<p><p>lists keyed by representative critter.</p>
|
463
|
-
</div></span></p>
|
464
|
-
|
465
|
-
<p></li></p>
|
466
|
-
|
467
|
-
<pre> </ul>
|
468
|
-
|
469
|
-
<h2>
|
470
|
-
Instance Method Summary
|
471
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
472
|
-
</h2>
|
473
|
-
|
474
|
-
<ul class="summary">
|
475
|
-
|
476
|
-
<li class="public ">
|
477
|
-
<span class="summary_signature">
|
478
|
-
|
479
|
-
<a href="#analyze%21-instance_method" title="#analyze! (instance method)">- (Object) <strong>analyze!</strong> </a>
|
480
|
-
|
481
|
-
</span>
|
482
|
-
|
483
|
-
<span class="summary_desc"><div class='inline'></pre>
|
484
|
-
|
485
|
-
<p><p>Alalyze evaluation results.</p> </div></span></p>
|
486
|
-
|
487
|
-
<p></li></p>
|
488
|
-
|
489
|
-
<pre> <li class="public ">
|
490
|
-
<span class="summary_signature">
|
491
|
-
|
492
|
-
<a href="#best_critter-instance_method" title="#best_critter (instance method)">- (Object) <strong>best_critter</strong> </a>
|
493
|
-
|
494
|
-
</span>
|
495
|
-
|
496
|
-
<span class="summary_desc"><div class='inline'></pre>
|
497
|
-
|
498
|
-
<p><p>The “best critter” is the critter with the lowest (closet to zero)
|
499
|
-
fitness rating.</p> </div></span></p>
|
500
|
-
|
501
|
-
<p></li></p>
|
502
|
-
|
503
|
-
<pre> <li class="public ">
|
504
|
-
<span class="summary_signature">
|
505
|
-
|
506
|
-
<a href="#dump_s-instance_method" title="#dump_s (instance method)">- (Object) <strong>dump_s</strong> </a>
|
507
|
-
|
508
|
-
</span>
|
509
|
-
|
510
|
-
<span class="summary_desc"><div class='inline'></div></span></pre>
|
511
|
-
|
512
|
-
<p></li></p>
|
513
|
-
|
514
|
-
<pre> <li class="public ">
|
515
|
-
<span class="summary_signature">
|
516
|
-
|
517
|
-
<a href="#evaluate%21-instance_method" title="#evaluate! (instance method)">- (Object) <strong>evaluate!</strong> </a>
|
518
|
-
|
519
|
-
</span>
|
520
|
-
|
521
|
-
<span class="summary_desc"><div class='inline'></pre>
|
522
|
-
|
523
|
-
<p><p>Called for each sequence.</p> </div></span></p>
|
524
|
-
|
525
|
-
<p></li></p>
|
526
|
-
|
527
|
-
<pre> <li class="public ">
|
528
|
-
<span class="summary_signature">
|
529
|
-
|
530
|
-
<a href="#evolve-instance_method" title="#evolve (instance method)">- (Object) <strong>evolve</strong> </a>
|
531
|
-
|
532
|
-
</span>
|
533
|
-
|
534
|
-
<span class="summary_desc"><div class='inline'></pre>
|
535
|
-
|
536
|
-
<p><p>Call this after evaluation.</p> </div></span></p>
|
537
|
-
|
538
|
-
<p></li></p>
|
539
|
-
|
540
|
-
<pre> <li class="public ">
|
541
|
-
<span class="summary_signature">
|
542
|
-
|
543
|
-
<a href="#express%21-instance_method" title="#express! (instance method)">- (Object) <strong>express!</strong> </a>
|
544
|
-
|
545
|
-
</span>
|
546
|
-
|
547
|
-
<span class="summary_desc"><div class='inline'></pre>
|
548
|
-
|
549
|
-
<p><p>Express the entire population.</p> </div></span></p>
|
550
|
-
|
551
|
-
<p></li></p>
|
552
|
-
|
553
|
-
<pre> <li class="public ">
|
554
|
-
<span class="summary_signature">
|
555
|
-
|
556
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Population) <strong>initialize</strong>(c, &amp;block) </a>
|
557
|
-
|
558
|
-
</span>
|
559
|
-
|
560
|
-
<span class="note title constructor">constructor</span>
|
561
|
-
|
562
|
-
<span class="summary_desc"><div class='inline'></pre>
|
563
|
-
|
564
|
-
<p><p>Create initial (ramdom) population of critters.</p>
|
565
|
-
</div></span></p>
|
566
|
-
|
567
|
-
<p></li></p>
|
568
|
-
|
569
|
-
<pre> <li class="public ">
|
570
|
-
<span class="summary_signature">
|
571
|
-
|
572
|
-
<a href="#initialize_for_recurrence%21-instance_method" title="#initialize_for_recurrence! (instance method)">- (Object) <strong>initialize_for_recurrence!</strong> </a>
|
573
|
-
|
574
|
-
</span>
|
575
|
-
|
576
|
-
<span class="summary_desc"><div class='inline'></pre>
|
577
|
-
|
578
|
-
<p><p>Make sure all critters are reset and prepared for recurrent
|
579
|
-
network evaluation.</p> </div></span></p>
|
580
|
-
|
581
|
-
<p></li></p>
|
582
|
-
|
583
|
-
<pre> <li class="public ">
|
584
|
-
<span class="summary_signature">
|
585
|
-
|
586
|
-
<a href="#mutate%21-instance_method" title="#mutate! (instance method)">- (Object) <strong>mutate!</strong> </a>
|
587
|
-
|
588
|
-
</span>
|
589
|
-
|
590
|
-
<span class="summary_desc"><div class='inline'></pre>
|
591
|
-
|
592
|
-
<p><p>Mutate the genes and neurons.</p> </div></span></p>
|
593
|
-
|
594
|
-
<p></li></p>
|
595
|
-
|
596
|
-
<pre> <li class="public ">
|
597
|
-
<span class="summary_signature">
|
598
|
-
|
599
|
-
<a href="#report-instance_method" title="#report (instance method)">- (Object) <strong>report</strong> </a>
|
600
|
-
|
601
|
-
</span>
|
602
|
-
|
603
|
-
<span class="summary_desc"><div class='inline'></pre>
|
604
|
-
|
605
|
-
<p><h2
|
606
|
-
id=“label-Generate+a+report+on+the+state+of+this+population.”>Generate a
|
607
|
-
report on the state of this population.</h2>
|
608
|
-
</div></span></p>
|
609
|
-
|
610
|
-
<p></li></p>
|
611
|
-
|
612
|
-
<pre> <li class="public ">
|
613
|
-
<span class="summary_signature">
|
614
|
-
|
615
|
-
<a href="#speciate%21-instance_method" title="#speciate! (instance method)">- (Object) <strong>speciate!</strong> </a>
|
616
|
-
|
617
|
-
</span>
|
618
|
-
|
619
|
-
<span class="summary_desc"><div class='inline'></pre>
|
620
|
-
|
621
|
-
<p><p>Group critters into species Note that the @species objects have
|
622
|
-
useful singleton methods: * @species.member? – checks all of the lists for
|
623
|
-
membership, not just the hash * @<a
|
624
|
-
href=“crit”>species</a>.fitness – fitness of the entire
|
625
|
-
species.</p> </div></span></p>
|
626
|
-
|
627
|
-
<p></li></p>
|
628
|
-
|
629
|
-
<pre> <li class="public ">
|
630
|
-
<span class="summary_signature">
|
631
|
-
|
632
|
-
<a href="#worst_critter-instance_method" title="#worst_critter (instance method)">- (Object) <strong>worst_critter</strong> </a>
|
633
|
-
|
634
|
-
</span>
|
635
|
-
|
636
|
-
<span class="summary_desc"><div class='inline'></pre>
|
637
|
-
|
638
|
-
<p><p>The “worst critter” is the critter with the highest (away from
|
639
|
-
zero) fitness rating.</p> </div></span></p>
|
640
|
-
|
641
|
-
<p></li></p>
|
642
|
-
|
643
|
-
<pre> </ul>
|
644
|
-
|
645
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></h3>
|
646
|
-
<p class="inherited"><span class='object_link'><a href="NeatOb.html#log-instance_method" title="NEAT::NeatOb#log (method)">#log</a></span>, <span class='object_link'><a href="NeatOb.html#log-class_method" title="NEAT::NeatOb.log (method)">log</a></span>, <span class='object_link'><a href="NeatOb.html#to_s-instance_method" title="NEAT::NeatOb#to_s (method)">#to_s</a></span></p>
|
647
|
-
|
648
|
-
<div id="constructor_details" class="method_details_list">
|
649
|
-
<h2>Constructor Details</h2>
|
650
|
-
|
651
|
-
<div class="method_details first">
|
652
|
-
<h3 class="signature first" id="initialize-instance_method">
|
653
|
-
|
654
|
-
- (<tt><span class='object_link'><a href="" title="NEAT::Population (class)">Population</a></span></tt>) <strong>initialize</strong>(c, &amp;block)</pre>
|
655
|
-
|
656
|
-
<p></h3><div class=“docstring”></p>
|
657
|
-
|
658
|
-
<pre><div class="discussion"></pre>
|
659
|
-
|
660
|
-
<p><p>Create initial (ramdom) population of critters</p></p>
|
661
|
-
|
662
|
-
<pre></div></pre>
|
663
|
-
|
664
|
-
<p></div> <div class=“tags”></p>
|
665
|
-
|
666
|
-
<p></div><table class=“source_code”></p>
|
667
|
-
|
668
|
-
<pre><tr>
|
669
|
-
<td>
|
670
|
-
<pre class="lines"></pre>
|
671
|
-
|
672
|
-
<p>37 38 39 40 41 42 43 44 45 46 47 48 49 50</pre></p>
|
673
|
-
|
674
|
-
<pre></td>
|
675
|
-
<td>
|
676
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 37</span></pre>
|
677
|
-
|
678
|
-
<p><span class='kw'>def</span> <span class='id
|
679
|
-
identifier rubyid_initialize'>initialize</span><span
|
680
|
-
class='lparen'>(</span><span class='id identifier
|
681
|
-
rubyid_c'>c</span><span
|
682
|
-
class='comma'>,</span> <span
|
683
|
-
class='op'>&amp;</span><span class='id
|
684
|
-
identifier rubyid_block'>block</span><span
|
685
|
-
class='rparen'>)</span></p>
|
686
|
-
|
687
|
-
<pre><span class='kw'>super</span>
|
688
|
-
<span class='ivar'>@input_neurons</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_neural_inputs'>neural_inputs</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span>
|
689
|
-
<span class='ivar'>@output_neurons</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_neural_outputs'>neural_outputs</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span>
|
690
|
-
<span class='ivar'>@hidden_neurons</span> <span class='op'>=</span> <span class='kw'>unless</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_neural_hidden'>neural_hidden</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
691
|
-
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_neural_hidden'>neural_hidden</span>
|
692
|
-
<span class='kw'>else</span>
|
693
|
-
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_neuron_catalog'>neuron_catalog</span><span class='period'>.</span><span class='id identifier rubyid_keep_if'>keep_if</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='kw'>not</span> <span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_input?'>input?</span><span class='rbrace'>}</span>
|
694
|
-
<span class='kw'>end</span>
|
695
|
-
<span class='ivar'>@critters</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='int'>0</span> <span class='op'>...</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_parms'>parms</span><span class='period'>.</span><span class='id identifier rubyid_start_population_size'>start_population_size</span> <span class='op'>||</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_parms'>parms</span><span class='period'>.</span><span class='id identifier rubyid_population_size'>population_size</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span>
|
696
|
-
<span class='const'>Critter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
697
|
-
<span class='kw'>end</span>
|
698
|
-
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span></pre>
|
699
|
-
|
700
|
-
<p><span class='kw'>end</span></pre></p>
|
701
|
-
|
702
|
-
<pre> </td>
|
703
|
-
</tr></pre>
|
704
|
-
|
705
|
-
<p></table> </div></p>
|
706
|
-
|
707
|
-
<p></div></p>
|
708
|
-
|
709
|
-
<pre><div id="instance_attr_details" class="attr_details">
|
710
|
-
<h2>Instance Attribute Details</h2>
|
711
|
-
|
712
|
-
<span id="critters=-instance_method"></span>
|
713
|
-
<div class="method_details first">
|
714
|
-
<h3 class="signature first" id="critters-instance_method">
|
715
|
-
|
716
|
-
- (<tt>Object</tt>) <strong>critters</strong></pre>
|
717
|
-
|
718
|
-
<p></h3><div class=“docstring”></p>
|
719
|
-
|
720
|
-
<pre><div class="discussion"></pre>
|
721
|
-
|
722
|
-
<p><p>list of critter in this population</p></p>
|
723
|
-
|
724
|
-
<pre></div></pre>
|
725
|
-
|
726
|
-
<p></div> <div class=“tags”></p>
|
727
|
-
|
728
|
-
<p></div><table class=“source_code”></p>
|
729
|
-
|
730
|
-
<pre><tr>
|
731
|
-
<td>
|
732
|
-
<pre class="lines"></pre>
|
733
|
-
|
734
|
-
<p>25 26 27</pre></p>
|
735
|
-
|
736
|
-
<pre></td>
|
737
|
-
<td>
|
738
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 25</span></pre>
|
739
|
-
|
740
|
-
<p><span class='kw'>def</span> <span class='id
|
741
|
-
identifier rubyid_critters'>critters</span></p>
|
742
|
-
|
743
|
-
<pre><span class='ivar'>@critters</span></pre>
|
744
|
-
|
745
|
-
<p><span class='kw'>end</span></pre></p>
|
746
|
-
|
747
|
-
<pre> </td>
|
748
|
-
</tr></pre>
|
749
|
-
|
750
|
-
<p></table> </div></p>
|
751
|
-
|
752
|
-
<pre> <span id=""></span>
|
753
|
-
<div class="method_details ">
|
754
|
-
<h3 class="signature " id="fitness-instance_method">
|
755
|
-
|
756
|
-
- (<tt>Object</tt>) <strong>fitness</strong> <span class="extras">(readonly)</span></pre>
|
757
|
-
|
758
|
-
<p></h3><div class=“docstring”></p>
|
759
|
-
|
760
|
-
<pre><div class="discussion"></pre>
|
761
|
-
|
762
|
-
<p><p>Overall population fitness and novelty</p></p>
|
763
|
-
|
764
|
-
<pre></div></pre>
|
765
|
-
|
766
|
-
<p></div> <div class=“tags”></p>
|
767
|
-
|
768
|
-
<p></div><table class=“source_code”></p>
|
769
|
-
|
770
|
-
<pre><tr>
|
771
|
-
<td>
|
772
|
-
<pre class="lines"></pre>
|
773
|
-
|
774
|
-
<p>28 29 30</pre></p>
|
775
|
-
|
776
|
-
<pre></td>
|
777
|
-
<td>
|
778
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 28</span></pre>
|
779
|
-
|
780
|
-
<p><span class='kw'>def</span> <span class='id
|
781
|
-
identifier rubyid_fitness'>fitness</span></p>
|
782
|
-
|
783
|
-
<pre><span class='ivar'>@fitness</span></pre>
|
784
|
-
|
785
|
-
<p><span class='kw'>end</span></pre></p>
|
786
|
-
|
787
|
-
<pre> </td>
|
788
|
-
</tr></pre>
|
789
|
-
|
790
|
-
<p></table> </div></p>
|
791
|
-
|
792
|
-
<pre> <span id="hidden_neurons=-instance_method"></span>
|
793
|
-
<div class="method_details ">
|
794
|
-
<h3 class="signature " id="hidden_neurons-instance_method">
|
795
|
-
|
796
|
-
- (<tt>Object</tt>) <strong>hidden_neurons</strong></pre>
|
797
|
-
|
798
|
-
<p></h3><div class=“docstring”></p>
|
799
|
-
|
800
|
-
<pre><div class="discussion"></pre>
|
801
|
-
|
802
|
-
<p><p>List of possible neuron classes for hidden neurons.</p></p>
|
803
|
-
|
804
|
-
<pre></div></pre>
|
805
|
-
|
806
|
-
<p></div> <div class=“tags”></p>
|
807
|
-
|
808
|
-
<p></div><table class=“source_code”></p>
|
809
|
-
|
810
|
-
<pre><tr>
|
811
|
-
<td>
|
812
|
-
<pre class="lines"></pre>
|
813
|
-
|
814
|
-
<p>16 17 18</pre></p>
|
815
|
-
|
816
|
-
<pre></td>
|
817
|
-
<td>
|
818
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 16</span></pre>
|
819
|
-
|
820
|
-
<p><span class='kw'>def</span> <span class='id
|
821
|
-
identifier rubyid_hidden_neurons'>hidden_neurons</span></p>
|
822
|
-
|
823
|
-
<pre><span class='ivar'>@hidden_neurons</span></pre>
|
824
|
-
|
825
|
-
<p><span class='kw'>end</span></pre></p>
|
826
|
-
|
827
|
-
<pre> </td>
|
828
|
-
</tr></pre>
|
829
|
-
|
830
|
-
<p></table> </div></p>
|
831
|
-
|
832
|
-
<pre> <span id="input_neurons=-instance_method"></span>
|
833
|
-
<div class="method_details ">
|
834
|
-
<h3 class="signature " id="input_neurons-instance_method">
|
835
|
-
|
836
|
-
- (<tt>Object</tt>) <strong>input_neurons</strong></pre>
|
837
|
-
|
838
|
-
<p></h3><div class=“docstring”></p>
|
839
|
-
|
840
|
-
<pre><div class="discussion"></pre>
|
841
|
-
|
842
|
-
<p><p>Ordered list or hash of input neuron classes (all critters
|
843
|
-
generated here shall have this)</p></p>
|
844
|
-
|
845
|
-
<pre></div></pre>
|
846
|
-
|
847
|
-
<p></div> <div class=“tags”></p>
|
848
|
-
|
849
|
-
<p></div><table class=“source_code”></p>
|
850
|
-
|
851
|
-
<pre><tr>
|
852
|
-
<td>
|
853
|
-
<pre class="lines"></pre>
|
854
|
-
|
855
|
-
<p>13 14 15</pre></p>
|
856
|
-
|
857
|
-
<pre></td>
|
858
|
-
<td>
|
859
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 13</span></pre>
|
860
|
-
|
861
|
-
<p><span class='kw'>def</span> <span class='id
|
862
|
-
identifier rubyid_input_neurons'>input_neurons</span></p>
|
863
|
-
|
864
|
-
<pre><span class='ivar'>@input_neurons</span></pre>
|
865
|
-
|
866
|
-
<p><span class='kw'>end</span></pre></p>
|
867
|
-
|
868
|
-
<pre> </td>
|
869
|
-
</tr></pre>
|
870
|
-
|
871
|
-
<p></table> </div></p>
|
872
|
-
|
873
|
-
<pre> <span id=""></span>
|
874
|
-
<div class="method_details ">
|
875
|
-
<h3 class="signature " id="novelty-instance_method">
|
876
|
-
|
877
|
-
- (<tt>Object</tt>) <strong>novelty</strong> <span class="extras">(readonly)</span></pre>
|
878
|
-
|
879
|
-
<p></h3><div class=“docstring”></p>
|
880
|
-
|
881
|
-
<pre><div class="discussion"></pre>
|
882
|
-
|
883
|
-
<p><p>Overall population fitness and novelty</p></p>
|
884
|
-
|
885
|
-
<pre></div></pre>
|
886
|
-
|
887
|
-
<p></div> <div class=“tags”></p>
|
888
|
-
|
889
|
-
<p></div><table class=“source_code”></p>
|
890
|
-
|
891
|
-
<pre><tr>
|
892
|
-
<td>
|
893
|
-
<pre class="lines"></pre>
|
894
|
-
|
895
|
-
<p>28 29 30</pre></p>
|
896
|
-
|
897
|
-
<pre></td>
|
898
|
-
<td>
|
899
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 28</span></pre>
|
900
|
-
|
901
|
-
<p><span class='kw'>def</span> <span class='id
|
902
|
-
identifier rubyid_novelty'>novelty</span></p>
|
903
|
-
|
904
|
-
<pre><span class='ivar'>@novelty</span></pre>
|
905
|
-
|
906
|
-
<p><span class='kw'>end</span></pre></p>
|
907
|
-
|
908
|
-
<pre> </td>
|
909
|
-
</tr></pre>
|
910
|
-
|
911
|
-
<p></table> </div></p>
|
912
|
-
|
913
|
-
<pre> <span id="output_neurons=-instance_method"></span>
|
914
|
-
<div class="method_details ">
|
915
|
-
<h3 class="signature " id="output_neurons-instance_method">
|
916
|
-
|
917
|
-
- (<tt>Object</tt>) <strong>output_neurons</strong></pre>
|
918
|
-
|
919
|
-
<p></h3><div class=“docstring”></p>
|
920
|
-
|
921
|
-
<pre><div class="discussion"></pre>
|
922
|
-
|
923
|
-
<p><p>Ordered list or hash of output neuron classes (all critters
|
924
|
-
generated here shall have this)</p></p>
|
925
|
-
|
926
|
-
<pre></div></pre>
|
927
|
-
|
928
|
-
<p></div> <div class=“tags”></p>
|
929
|
-
|
930
|
-
<p></div><table class=“source_code”></p>
|
931
|
-
|
932
|
-
<pre><tr>
|
933
|
-
<td>
|
934
|
-
<pre class="lines"></pre>
|
935
|
-
|
936
|
-
<p>20 21 22</pre></p>
|
937
|
-
|
938
|
-
<pre></td>
|
939
|
-
<td>
|
940
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 20</span></pre>
|
941
|
-
|
942
|
-
<p><span class='kw'>def</span> <span class='id
|
943
|
-
identifier rubyid_output_neurons'>output_neurons</span></p>
|
944
|
-
|
945
|
-
<pre><span class='ivar'>@output_neurons</span></pre>
|
946
|
-
|
947
|
-
<p><span class='kw'>end</span></pre></p>
|
948
|
-
|
949
|
-
<pre> </td>
|
950
|
-
</tr></pre>
|
951
|
-
|
952
|
-
<p></table> </div></p>
|
953
|
-
|
954
|
-
<pre> <span id=""></span>
|
955
|
-
<div class="method_details ">
|
956
|
-
<h3 class="signature " id="species-instance_method">
|
957
|
-
|
958
|
-
- (<tt>Object</tt>) <strong>species</strong> <span class="extras">(readonly)</span></pre>
|
959
|
-
|
960
|
-
<p></h3><div class=“docstring”></p>
|
961
|
-
|
962
|
-
<pre><div class="discussion"></pre>
|
963
|
-
|
964
|
-
<p><p>Hash list of species lists</p></p>
|
965
|
-
|
966
|
-
<pre></div></pre>
|
967
|
-
|
968
|
-
<p></div> <div class=“tags”></p>
|
969
|
-
|
970
|
-
<p></div><table class=“source_code”></p>
|
971
|
-
|
972
|
-
<pre><tr>
|
973
|
-
<td>
|
974
|
-
<pre class="lines"></pre>
|
975
|
-
|
976
|
-
<p>31 32 33</pre></p>
|
977
|
-
|
978
|
-
<pre></td>
|
979
|
-
<td>
|
980
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 31</span></pre>
|
981
|
-
|
982
|
-
<p><span class='kw'>def</span> <span class='id
|
983
|
-
identifier rubyid_species'>species</span></p>
|
984
|
-
|
985
|
-
<pre><span class='ivar'>@species</span></pre>
|
986
|
-
|
987
|
-
<p><span class='kw'>end</span></pre></p>
|
988
|
-
|
989
|
-
<pre> </td>
|
990
|
-
</tr></pre>
|
991
|
-
|
992
|
-
<p></table> </div></p>
|
993
|
-
|
994
|
-
<pre> <span id="traits=-instance_method"></span>
|
995
|
-
<div class="method_details ">
|
996
|
-
<h3 class="signature " id="traits-instance_method">
|
997
|
-
|
998
|
-
- (<tt>Object</tt>) <strong>traits</strong></pre>
|
999
|
-
|
1000
|
-
<p></h3><div class=“docstring”></p>
|
1001
|
-
|
1002
|
-
<pre><div class="discussion"></pre>
|
1003
|
-
|
1004
|
-
<p><p>Returns the value of attribute traits</p></p>
|
1005
|
-
|
1006
|
-
<pre></div></pre>
|
1007
|
-
|
1008
|
-
<p></div> <div class=“tags”></p>
|
1009
|
-
|
1010
|
-
<p></div><table class=“source_code”></p>
|
1011
|
-
|
1012
|
-
<pre><tr>
|
1013
|
-
<td>
|
1014
|
-
<pre class="lines"></pre>
|
1015
|
-
|
1016
|
-
<p>22 23 24</pre></p>
|
1017
|
-
|
1018
|
-
<pre></td>
|
1019
|
-
<td>
|
1020
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 22</span></pre>
|
1021
|
-
|
1022
|
-
<p><span class='kw'>def</span> <span class='id
|
1023
|
-
identifier rubyid_traits'>traits</span></p>
|
1024
|
-
|
1025
|
-
<pre><span class='ivar'>@traits</span></pre>
|
1026
|
-
|
1027
|
-
<p><span class='kw'>end</span></pre></p>
|
1028
|
-
|
1029
|
-
<pre> </td>
|
1030
|
-
</tr></pre>
|
1031
|
-
|
1032
|
-
<p></table> </div></p>
|
1033
|
-
|
1034
|
-
<pre></div>
|
1035
|
-
|
1036
|
-
<div id="class_method_details" class="method_details_list">
|
1037
|
-
<h2>Class Method Details</h2>
|
1038
|
-
|
1039
|
-
<div class="method_details first">
|
1040
|
-
<h3 class="signature first" id="compactify!-class_method">
|
1041
|
-
|
1042
|
-
+ (<tt>Object</tt>) <strong>compactify!</strong>(parm)</pre>
|
1043
|
-
|
1044
|
-
<p></h3><table class=“source_code”></p>
|
1045
|
-
|
1046
|
-
<pre><tr>
|
1047
|
-
<td>
|
1048
|
-
<pre class="lines"></pre>
|
1049
|
-
|
1050
|
-
<p>102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
1051
|
-
120</pre></p>
|
1052
|
-
|
1053
|
-
<pre></td>
|
1054
|
-
<td>
|
1055
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 102</span></pre>
|
1056
|
-
|
1057
|
-
<p><span class='kw'>def</span> <span
|
1058
|
-
class='ivar'>@species</span><span
|
1059
|
-
class='period'>.</span><span class='id identifier
|
1060
|
-
rubyid_compactify!'>compactify!</span><span
|
1061
|
-
class='lparen'>(</span><span class='id identifier
|
1062
|
-
rubyid_parm'>parm</span><span
|
1063
|
-
class='rparen'>)</span></p>
|
1064
|
-
|
1065
|
-
<pre><span class='id identifier rubyid_mutt'>mutt</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='symbol'>:mutt</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span>
|
1066
|
-
<span class='id identifier rubyid_splist'>splist</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;=</span> <span class='id identifier rubyid_parm'>parm</span><span class='period'>.</span><span class='id identifier rubyid_smallest_species'>smallest_species</span>
|
1067
|
-
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span>
|
1068
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_k'>k</span>
|
1069
|
-
<span class='id identifier rubyid_splist'>splist</span>
|
1070
|
-
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
1071
|
-
|
1072
|
-
<span class='comment'># FIXME this code is not dry!!!!</pre>
|
1073
|
-
|
1074
|
-
<p></span> <span class='kw'>def</span> <span
|
1075
|
-
class='id identifier rubyid_mutt'>mutt</span><span
|
1076
|
-
class='period'>.</span><span class='id identifier
|
1077
|
-
rubyid_fitness='>fitness=</span><span
|
1078
|
-
class='lparen'>(</span><span class='id identifier
|
1079
|
-
rubyid_fit'>fit</span><span
|
1080
|
-
class='rparen'>)</span></p>
|
1081
|
-
|
1082
|
-
<pre> <span class='ivar'>@fitness</span> <span class='op'>=</span> <span class='id identifier rubyid_fit'>fit</span>
|
1083
|
-
<span class='kw'>end</span>
|
1084
|
-
|
1085
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_mutt'>mutt</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span>
|
1086
|
-
<span class='ivar'>@fitness</span>
|
1087
|
-
<span class='kw'>end</span>
|
1088
|
-
|
1089
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:mutt</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='symbol'>:mutt</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span></pre>
|
1090
|
-
|
1091
|
-
<p><span class='kw'>end</span></pre></p>
|
1092
|
-
|
1093
|
-
<pre> </td>
|
1094
|
-
</tr></pre>
|
1095
|
-
|
1096
|
-
<p></table> </div></p>
|
1097
|
-
|
1098
|
-
<pre> <div class="method_details ">
|
1099
|
-
<h3 class="signature " id="evaluate!-class_method">
|
1100
|
-
|
1101
|
-
+ (<tt>Object</tt>) <strong>evaluate!</strong></pre>
|
1102
|
-
|
1103
|
-
<p></h3><table class=“source_code”></p>
|
1104
|
-
|
1105
|
-
<pre><tr>
|
1106
|
-
<td>
|
1107
|
-
<pre class="lines"></pre>
|
1108
|
-
|
1109
|
-
<p>96 97 98 99 100</pre></p>
|
1110
|
-
|
1111
|
-
<pre></td>
|
1112
|
-
<td>
|
1113
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 96</span></pre>
|
1114
|
-
|
1115
|
-
<p><span class='kw'>def</span> <span
|
1116
|
-
class='ivar'>@species</span><span
|
1117
|
-
class='period'>.</span><span class='id identifier
|
1118
|
-
rubyid_evaluate!'>evaluate!</span></p>
|
1119
|
-
|
1120
|
-
<pre><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_sp'>sp</span><span class='op'>|</span>
|
1121
|
-
<span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span> <span class='op'>=</span> <span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_crit'>crit</span><span class='op'>|</span> <span class='id identifier rubyid_crit'>crit</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='op'>+</span><span class='id identifier rubyid_b'>b</span><span class='rbrace'>}</span> <span class='op'>/</span> <span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
1122
|
-
<span class='kw'>end</span></pre>
|
1123
|
-
|
1124
|
-
<p><span class='kw'>end</span></pre></p>
|
1125
|
-
|
1126
|
-
<pre> </td>
|
1127
|
-
</tr></pre>
|
1128
|
-
|
1129
|
-
<p></table> </div></p>
|
1130
|
-
|
1131
|
-
<pre> <div class="method_details ">
|
1132
|
-
<h3 class="signature " id="member?-class_method">
|
1133
|
-
|
1134
|
-
+ (<tt>Boolean</tt>) <strong>member?</strong>(crit)</pre>
|
1135
|
-
|
1136
|
-
<p></h3><div class=“docstring”></p>
|
1137
|
-
|
1138
|
-
<pre><div class="discussion"></pre>
|
1139
|
-
|
1140
|
-
<p><p>lists keyed by representative critter</p></p>
|
1141
|
-
|
1142
|
-
<pre></div></pre>
|
1143
|
-
|
1144
|
-
<p></div> <div class=“tags”></p>
|
1145
|
-
|
1146
|
-
<p><p class=“tag_title”>Returns:</p> <ul class=“return”></p>
|
1147
|
-
|
1148
|
-
<pre><li>
|
1149
|
-
|
1150
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1151
|
-
|
1152
|
-
</li></pre>
|
1153
|
-
|
1154
|
-
<p></ul></p>
|
1155
|
-
|
1156
|
-
<p></div><table class=“source_code”></p>
|
1157
|
-
|
1158
|
-
<pre><tr>
|
1159
|
-
<td>
|
1160
|
-
<pre class="lines"></pre>
|
1161
|
-
|
1162
|
-
<p>92 93 94</pre></p>
|
1163
|
-
|
1164
|
-
<pre></td>
|
1165
|
-
<td>
|
1166
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 92</span></pre>
|
1167
|
-
|
1168
|
-
<p><span class='kw'>def</span> <span
|
1169
|
-
class='ivar'>@species</span><span
|
1170
|
-
class='period'>.</span><span class='id identifier
|
1171
|
-
rubyid_member?'>member?</span><span
|
1172
|
-
class='lparen'>(</span><span class='id identifier
|
1173
|
-
rubyid_crit'>crit</span><span
|
1174
|
-
class='rparen'>)</span></p>
|
1175
|
-
|
1176
|
-
<pre><span class='kw'>super</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span><span class='lparen'>(</span><span class='id identifier rubyid_crit'>crit</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_li'>li</span><span class='op'>|</span> <span class='id identifier rubyid_li'>li</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span> <span class='id identifier rubyid_crit'>crit</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_t1'>t1</span><span class='comma'>,</span> <span class='id identifier rubyid_t2'>t2</span><span class='op'>|</span> <span class='id identifier rubyid_t1'>t1</span> <span class='kw'>or</span> <span class='id identifier rubyid_t2'>t2</span> <span class='rbrace'>}</span></pre>
|
1177
|
-
|
1178
|
-
<p><span class='kw'>end</span></pre></p>
|
1179
|
-
|
1180
|
-
<pre> </td>
|
1181
|
-
</tr></pre>
|
1182
|
-
|
1183
|
-
<p></table> </div></p>
|
1184
|
-
|
1185
|
-
<pre></div>
|
1186
|
-
|
1187
|
-
<div id="instance_method_details" class="method_details_list">
|
1188
|
-
<h2>Instance Method Details</h2>
|
1189
|
-
|
1190
|
-
<div class="method_details first">
|
1191
|
-
<h3 class="signature first" id="analyze!-instance_method">
|
1192
|
-
|
1193
|
-
- (<tt>Object</tt>) <strong>analyze!</strong></pre>
|
1194
|
-
|
1195
|
-
<p></h3><div class=“docstring”></p>
|
1196
|
-
|
1197
|
-
<pre><div class="discussion"></pre>
|
1198
|
-
|
1199
|
-
<p><p>Alalyze evaluation results.</p></p>
|
1200
|
-
|
1201
|
-
<pre></div></pre>
|
1202
|
-
|
1203
|
-
<p></div> <div class=“tags”></p>
|
1204
|
-
|
1205
|
-
<p></div><table class=“source_code”></p>
|
1206
|
-
|
1207
|
-
<pre><tr>
|
1208
|
-
<td>
|
1209
|
-
<pre class="lines"></pre>
|
1210
|
-
|
1211
|
-
<p>74 75 76</pre></p>
|
1212
|
-
|
1213
|
-
<pre></td>
|
1214
|
-
<td>
|
1215
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 74</span></pre>
|
1216
|
-
|
1217
|
-
<p><span class='kw'>def</span> <span class='id
|
1218
|
-
identifier rubyid_analyze!'>analyze!</span></p>
|
1219
|
-
|
1220
|
-
<pre><span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_critter'>critter</span><span class='op'>|</span> <span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_evaluator'>evaluator</span><span class='period'>.</span><span class='id identifier rubyid_analyze_for_fitness!'>analyze_for_fitness!</span> <span class='id identifier rubyid_critter'>critter</span> <span class='rbrace'>}</span></pre>
|
1221
|
-
|
1222
|
-
<p><span class='kw'>end</span></pre></p>
|
1223
|
-
|
1224
|
-
<pre> </td>
|
1225
|
-
</tr></pre>
|
1226
|
-
|
1227
|
-
<p></table> </div></p>
|
1228
|
-
|
1229
|
-
<pre> <div class="method_details ">
|
1230
|
-
<h3 class="signature " id="best_critter-instance_method">
|
1231
|
-
|
1232
|
-
- (<tt>Object</tt>) <strong>best_critter</strong></pre>
|
1233
|
-
|
1234
|
-
<p></h3><div class=“docstring”></p>
|
1235
|
-
|
1236
|
-
<pre><div class="discussion"></pre>
|
1237
|
-
|
1238
|
-
<p><p>The “best critter” is the critter with the lowest (closet to zero)
|
1239
|
-
fitness rating.</p></p>
|
1240
|
-
|
1241
|
-
<pre></div></pre>
|
1242
|
-
|
1243
|
-
<p></div> <div class=“tags”></p>
|
1244
|
-
|
1245
|
-
<p></div><table class=“source_code”></p>
|
1246
|
-
|
1247
|
-
<pre><tr>
|
1248
|
-
<td>
|
1249
|
-
<pre class="lines"></pre>
|
1250
|
-
|
1251
|
-
<p>176 177 178 179 180 181 182</pre></p>
|
1252
|
-
|
1253
|
-
<pre></td>
|
1254
|
-
<td>
|
1255
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 176</span></pre>
|
1256
|
-
|
1257
|
-
<p><span class='kw'>def</span> <span class='id
|
1258
|
-
identifier rubyid_best_critter'>best_critter</span></p>
|
1259
|
-
|
1260
|
-
<pre><span class='kw'>unless</span> <span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_compare_func'>compare_func</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1261
|
-
<span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_compare_func'>compare_func</span><span class='period'>.</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1262
|
-
<span class='kw'>else</span>
|
1263
|
-
<span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span> <span class='op'>&lt;=&gt;</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rbrace'>}</span>
|
1264
|
-
<span class='kw'>end</span></pre>
|
1265
|
-
|
1266
|
-
<p><span class='kw'>end</span></pre></p>
|
1267
|
-
|
1268
|
-
<pre> </td>
|
1269
|
-
</tr></pre>
|
1270
|
-
|
1271
|
-
<p></table> </div></p>
|
1272
|
-
|
1273
|
-
<pre> <div class="method_details ">
|
1274
|
-
<h3 class="signature " id="dump_s-instance_method">
|
1275
|
-
|
1276
|
-
- (<tt>Object</tt>) <strong>dump_s</strong></pre>
|
1277
|
-
|
1278
|
-
<p></h3><table class=“source_code”></p>
|
1279
|
-
|
1280
|
-
<pre><tr>
|
1281
|
-
<td>
|
1282
|
-
<pre class="lines"></pre>
|
1283
|
-
|
1284
|
-
<p>194 195 196</pre></p>
|
1285
|
-
|
1286
|
-
<pre></td>
|
1287
|
-
<td>
|
1288
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 194</span></pre>
|
1289
|
-
|
1290
|
-
<p><span class='kw'>def</span> <span class='id
|
1291
|
-
identifier rubyid_dump_s'>dump_s</span></p>
|
1292
|
-
|
1293
|
-
<pre><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\npopulation:\n</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_crit'>crit</span><span class='op'>|</span> <span class='id identifier rubyid_crit'>crit</span><span class='period'>.</span><span class='id identifier rubyid_dump_s'>dump_s</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></pre>
|
1294
|
-
|
1295
|
-
<p><span class='kw'>end</span></pre></p>
|
1296
|
-
|
1297
|
-
<pre> </td>
|
1298
|
-
</tr></pre>
|
1299
|
-
|
1300
|
-
<p></table> </div></p>
|
1301
|
-
|
1302
|
-
<pre> <div class="method_details ">
|
1303
|
-
<h3 class="signature " id="evaluate!-instance_method">
|
1304
|
-
|
1305
|
-
- (<tt>Object</tt>) <strong>evaluate!</strong></pre>
|
1306
|
-
|
1307
|
-
<p></h3><div class=“docstring”></p>
|
1308
|
-
|
1309
|
-
<pre><div class="discussion"></pre>
|
1310
|
-
|
1311
|
-
<p><p>Called for each sequence.</p></p>
|
1312
|
-
|
1313
|
-
<pre></div></pre>
|
1314
|
-
|
1315
|
-
<p></div> <div class=“tags”></p>
|
1316
|
-
|
1317
|
-
<p></div><table class=“source_code”></p>
|
1318
|
-
|
1319
|
-
<pre><tr>
|
1320
|
-
<td>
|
1321
|
-
<pre class="lines"></pre>
|
1322
|
-
|
1323
|
-
<p>69 70 71</pre></p>
|
1324
|
-
|
1325
|
-
<pre></td>
|
1326
|
-
<td>
|
1327
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 69</span></pre>
|
1328
|
-
|
1329
|
-
<p><span class='kw'>def</span> <span class='id
|
1330
|
-
identifier rubyid_evaluate!'>evaluate!</span></p>
|
1331
|
-
|
1332
|
-
<pre><span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_critter'>critter</span><span class='op'>|</span> <span class='id identifier rubyid_critter'>critter</span><span class='period'>.</span><span class='id identifier rubyid_evaluate!'>evaluate!</span> <span class='rbrace'>}</span></pre>
|
1333
|
-
|
1334
|
-
<p><span class='kw'>end</span></pre></p>
|
1335
|
-
|
1336
|
-
<pre> </td>
|
1337
|
-
</tr></pre>
|
1338
|
-
|
1339
|
-
<p></table> </div></p>
|
1340
|
-
|
1341
|
-
<pre> <div class="method_details ">
|
1342
|
-
<h3 class="signature " id="evolve-instance_method">
|
1343
|
-
|
1344
|
-
- (<tt>Object</tt>) <strong>evolve</strong></pre>
|
1345
|
-
|
1346
|
-
<p></h3><div class=“docstring”></p>
|
1347
|
-
|
1348
|
-
<pre><div class="discussion"></pre>
|
1349
|
-
|
1350
|
-
<p><p>Call this after evaluation. Returns a newly-evolved
|
1351
|
-
population.</p></p>
|
1352
|
-
|
1353
|
-
<pre></div></pre>
|
1354
|
-
|
1355
|
-
<p></div> <div class=“tags”></p>
|
1356
|
-
|
1357
|
-
<p></div><table class=“source_code”></p>
|
1358
|
-
|
1359
|
-
<pre><tr>
|
1360
|
-
<td>
|
1361
|
-
<pre class="lines"></pre>
|
1362
|
-
|
1363
|
-
<p>80 81 82</pre></p>
|
1364
|
-
|
1365
|
-
<pre></td>
|
1366
|
-
<td>
|
1367
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 80</span></pre>
|
1368
|
-
|
1369
|
-
<p><span class='kw'>def</span> <span class='id
|
1370
|
-
identifier rubyid_evolve'>evolve</span></p>
|
1371
|
-
|
1372
|
-
<pre><span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_evolver'>evolver</span><span class='period'>.</span><span class='id identifier rubyid_evolve'>evolve</span> <span class='kw'>self</span></pre>
|
1373
|
-
|
1374
|
-
<p><span class='kw'>end</span></pre></p>
|
1375
|
-
|
1376
|
-
<pre> </td>
|
1377
|
-
</tr></pre>
|
1378
|
-
|
1379
|
-
<p></table> </div></p>
|
1380
|
-
|
1381
|
-
<pre> <div class="method_details ">
|
1382
|
-
<h3 class="signature " id="express!-instance_method">
|
1383
|
-
|
1384
|
-
- (<tt>Object</tt>) <strong>express!</strong></pre>
|
1385
|
-
|
1386
|
-
<p></h3><div class=“docstring”></p>
|
1387
|
-
|
1388
|
-
<pre><div class="discussion"></pre>
|
1389
|
-
|
1390
|
-
<p><p>Express the entire population.</p></p>
|
1391
|
-
|
1392
|
-
<pre></div></pre>
|
1393
|
-
|
1394
|
-
<p></div> <div class=“tags”></p>
|
1395
|
-
|
1396
|
-
<p></div><table class=“source_code”></p>
|
1397
|
-
|
1398
|
-
<pre><tr>
|
1399
|
-
<td>
|
1400
|
-
<pre class="lines"></pre>
|
1401
|
-
|
1402
|
-
<p>64 65 66</pre></p>
|
1403
|
-
|
1404
|
-
<pre></td>
|
1405
|
-
<td>
|
1406
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 64</span></pre>
|
1407
|
-
|
1408
|
-
<p><span class='kw'>def</span> <span class='id
|
1409
|
-
identifier rubyid_express!'>express!</span></p>
|
1410
|
-
|
1411
|
-
<pre><span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_critter'>critter</span><span class='op'>|</span> <span class='id identifier rubyid_critter'>critter</span><span class='period'>.</span><span class='id identifier rubyid_express!'>express!</span> <span class='rbrace'>}</span></pre>
|
1412
|
-
|
1413
|
-
<p><span class='kw'>end</span></pre></p>
|
1414
|
-
|
1415
|
-
<pre> </td>
|
1416
|
-
</tr></pre>
|
1417
|
-
|
1418
|
-
<p></table> </div></p>
|
1419
|
-
|
1420
|
-
<pre> <div class="method_details ">
|
1421
|
-
<h3 class="signature " id="initialize_for_recurrence!-instance_method">
|
1422
|
-
|
1423
|
-
- (<tt>Object</tt>) <strong>initialize_for_recurrence!</strong></pre>
|
1424
|
-
|
1425
|
-
<p></h3><div class=“docstring”></p>
|
1426
|
-
|
1427
|
-
<pre><div class="discussion"></pre>
|
1428
|
-
|
1429
|
-
<p><p>Make sure all critters are reset and prepared for recurrent
|
1430
|
-
network evaluation.</p></p>
|
1431
|
-
|
1432
|
-
<pre></div></pre>
|
1433
|
-
|
1434
|
-
<p></div> <div class=“tags”></p>
|
1435
|
-
|
1436
|
-
<p></div><table class=“source_code”></p>
|
1437
|
-
|
1438
|
-
<pre><tr>
|
1439
|
-
<td>
|
1440
|
-
<pre class="lines"></pre>
|
1441
|
-
|
1442
|
-
<p>54 55 56</pre></p>
|
1443
|
-
|
1444
|
-
<pre></td>
|
1445
|
-
<td>
|
1446
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 54</span></pre>
|
1447
|
-
|
1448
|
-
<p><span class='kw'>def</span> <span class='id
|
1449
|
-
identifier
|
1450
|
-
rubyid_initialize_for_recurrence!'>initialize_for_recurrence!</span></p>
|
1451
|
-
|
1452
|
-
<pre><span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_crit'>crit</span><span class='op'>|</span> <span class='id identifier rubyid_crit'>crit</span><span class='period'>.</span><span class='id identifier rubyid_initialize_neurons!'>initialize_neurons!</span><span class='rbrace'>}</span></pre>
|
1453
|
-
|
1454
|
-
<p><span class='kw'>end</span></pre></p>
|
1455
|
-
|
1456
|
-
<pre> </td>
|
1457
|
-
</tr></pre>
|
1458
|
-
|
1459
|
-
<p></table> </div></p>
|
1460
|
-
|
1461
|
-
<pre> <div class="method_details ">
|
1462
|
-
<h3 class="signature " id="mutate!-instance_method">
|
1463
|
-
|
1464
|
-
- (<tt>Object</tt>) <strong>mutate!</strong></pre>
|
1465
|
-
|
1466
|
-
<p></h3><div class=“docstring”></p>
|
1467
|
-
|
1468
|
-
<pre><div class="discussion"></pre>
|
1469
|
-
|
1470
|
-
<p><p>Mutate the genes and neurons.</p></p>
|
1471
|
-
|
1472
|
-
<pre></div></pre>
|
1473
|
-
|
1474
|
-
<p></div> <div class=“tags”></p>
|
1475
|
-
|
1476
|
-
<p></div><table class=“source_code”></p>
|
1477
|
-
|
1478
|
-
<pre><tr>
|
1479
|
-
<td>
|
1480
|
-
<pre class="lines"></pre>
|
1481
|
-
|
1482
|
-
<p>59 60 61</pre></p>
|
1483
|
-
|
1484
|
-
<pre></td>
|
1485
|
-
<td>
|
1486
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 59</span></pre>
|
1487
|
-
|
1488
|
-
<p><span class='kw'>def</span> <span class='id
|
1489
|
-
identifier rubyid_mutate!'>mutate!</span></p>
|
1490
|
-
|
1491
|
-
<pre><span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_evolver'>evolver</span><span class='period'>.</span><span class='id identifier rubyid_mutate!'>mutate!</span> <span class='kw'>self</span></pre>
|
1492
|
-
|
1493
|
-
<p><span class='kw'>end</span></pre></p>
|
1494
|
-
|
1495
|
-
<pre> </td>
|
1496
|
-
</tr></pre>
|
1497
|
-
|
1498
|
-
<p></table> </div></p>
|
1499
|
-
|
1500
|
-
<pre> <div class="method_details ">
|
1501
|
-
<h3 class="signature " id="report-instance_method">
|
1502
|
-
|
1503
|
-
- (<tt>Object</tt>) <strong>report</strong></pre>
|
1504
|
-
|
1505
|
-
<p></h3><div class=“docstring”></p>
|
1506
|
-
|
1507
|
-
<pre><div class="discussion"></pre>
|
1508
|
-
|
1509
|
-
<p><h2
|
1510
|
-
id=“label-Generate+a+report+on+the+state+of+this+population.”>Generate a
|
1511
|
-
report on the state of this population.</h2></p>
|
1512
|
-
|
1513
|
-
<pre></div></pre>
|
1514
|
-
|
1515
|
-
<p></div> <div class=“tags”></p>
|
1516
|
-
|
1517
|
-
<p></div><table class=“source_code”></p>
|
1518
|
-
|
1519
|
-
<pre><tr>
|
1520
|
-
<td>
|
1521
|
-
<pre class="lines"></pre>
|
1522
|
-
|
1523
|
-
<p>165 166 167 168 169 170 171 172</pre></p>
|
1524
|
-
|
1525
|
-
<pre></td>
|
1526
|
-
<td>
|
1527
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 165</span></pre>
|
1528
|
-
|
1529
|
-
<p><span class='kw'>def</span> <span class='id
|
1530
|
-
identifier rubyid_report'>report</span></p>
|
1531
|
-
|
1532
|
-
<pre><span class='lbrace'>{</span>
|
1533
|
-
<span class='label'>fitness:</span> <span class='id identifier rubyid_report_fitness'>report_fitness</span><span class='comma'>,</span>
|
1534
|
-
<span class='label'>fitness_species:</span> <span class='id identifier rubyid_report_fitness_species'>report_fitness_species</span><span class='comma'>,</span>
|
1535
|
-
<span class='label'>best_critter:</span> <span class='id identifier rubyid_report_best_fit'>report_best_fit</span><span class='comma'>,</span>
|
1536
|
-
<span class='label'>worst_critter:</span> <span class='id identifier rubyid_report_worst_fit'>report_worst_fit</span><span class='comma'>,</span>
|
1537
|
-
<span class='rbrace'>}</span></pre>
|
1538
|
-
|
1539
|
-
<p><span class='kw'>end</span></pre></p>
|
1540
|
-
|
1541
|
-
<pre> </td>
|
1542
|
-
</tr></pre>
|
1543
|
-
|
1544
|
-
<p></table> </div></p>
|
1545
|
-
|
1546
|
-
<pre> <div class="method_details ">
|
1547
|
-
<h3 class="signature " id="speciate!-instance_method">
|
1548
|
-
|
1549
|
-
- (<tt>Object</tt>) <strong>speciate!</strong></pre>
|
1550
|
-
|
1551
|
-
<p></h3><div class=“docstring”></p>
|
1552
|
-
|
1553
|
-
<pre><div class="discussion"></pre>
|
1554
|
-
|
1555
|
-
<p><p>Group critters into species Note that the @species objects have
|
1556
|
-
useful singleton methods:</p> <ul><li>
|
1557
|
-
<p>@species.member? – checks all of the lists for membership, not
|
1558
|
-
just the hash</p> </li><li> <p>@<a
|
1559
|
-
href=“crit”>species</a>.fitness – fitness of the entire
|
1560
|
-
species</p> </li></ul></p>
|
1561
|
-
|
1562
|
-
<pre></div></pre>
|
1563
|
-
|
1564
|
-
<p></div> <div class=“tags”></p>
|
1565
|
-
|
1566
|
-
<p></div><table class=“source_code”></p>
|
1567
|
-
|
1568
|
-
<pre><tr>
|
1569
|
-
<td>
|
1570
|
-
<pre class="lines"></pre>
|
1571
|
-
|
1572
|
-
<p>89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
1573
|
-
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
1574
|
-
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
1575
|
-
148 149 150 151 152 153 154 155 156 157 158 159 160 161</pre></p>
|
1576
|
-
|
1577
|
-
<pre></td>
|
1578
|
-
<td>
|
1579
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 89</span></pre>
|
1580
|
-
|
1581
|
-
<p><span class='kw'>def</span> <span class='id
|
1582
|
-
identifier rubyid_speciate!'>speciate!</span></p>
|
1583
|
-
|
1584
|
-
<pre><span class='comment'># We blow away existing species and create our own member? function</pre>
|
1585
|
-
|
1586
|
-
<p></span> <span class='ivar'>@species</span>
|
1587
|
-
<span class='op'>=</span> <span
|
1588
|
-
class='lbrace'>{</span><span
|
1589
|
-
class='rbrace'>}</span> <span
|
1590
|
-
class='comment'># lists keyed by representative critter
|
1591
|
-
</span> <span class='kw'>def</span> <span
|
1592
|
-
class='ivar'>@species</span><span
|
1593
|
-
class='period'>.</span><span class='id identifier
|
1594
|
-
rubyid_member?'>member?</span><span
|
1595
|
-
class='lparen'>(</span><span class='id identifier
|
1596
|
-
rubyid_crit'>crit</span><span
|
1597
|
-
class='rparen'>)</span></p>
|
1598
|
-
|
1599
|
-
<pre> <span class='kw'>super</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span><span class='lparen'>(</span><span class='id identifier rubyid_crit'>crit</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_li'>li</span><span class='op'>|</span> <span class='id identifier rubyid_li'>li</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span> <span class='id identifier rubyid_crit'>crit</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_t1'>t1</span><span class='comma'>,</span> <span class='id identifier rubyid_t2'>t2</span><span class='op'>|</span> <span class='id identifier rubyid_t1'>t1</span> <span class='kw'>or</span> <span class='id identifier rubyid_t2'>t2</span> <span class='rbrace'>}</span>
|
1600
|
-
<span class='kw'>end</span>
|
1601
|
-
|
1602
|
-
<span class='kw'>def</span> <span class='ivar'>@species</span><span class='period'>.</span><span class='id identifier rubyid_evaluate!'>evaluate!</span>
|
1603
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_sp'>sp</span><span class='op'>|</span>
|
1604
|
-
<span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span> <span class='op'>=</span> <span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_crit'>crit</span><span class='op'>|</span> <span class='id identifier rubyid_crit'>crit</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reduce'>reduce</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='op'>+</span><span class='id identifier rubyid_b'>b</span><span class='rbrace'>}</span> <span class='op'>/</span> <span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
1605
|
-
<span class='kw'>end</span>
|
1606
|
-
<span class='kw'>end</span>
|
1607
|
-
|
1608
|
-
<span class='kw'>def</span> <span class='ivar'>@species</span><span class='period'>.</span><span class='id identifier rubyid_compactify!'>compactify!</span><span class='lparen'>(</span><span class='id identifier rubyid_parm'>parm</span><span class='rparen'>)</span>
|
1609
|
-
<span class='id identifier rubyid_mutt'>mutt</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='symbol'>:mutt</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span>
|
1610
|
-
<span class='id identifier rubyid_splist'>splist</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;=</span> <span class='id identifier rubyid_parm'>parm</span><span class='period'>.</span><span class='id identifier rubyid_smallest_species'>smallest_species</span>
|
1611
|
-
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_splist'>splist</span><span class='op'>|</span>
|
1612
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_k'>k</span>
|
1613
|
-
<span class='id identifier rubyid_splist'>splist</span>
|
1614
|
-
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
1615
|
-
|
1616
|
-
<span class='comment'># FIXME this code is not dry!!!!</pre>
|
1617
|
-
|
1618
|
-
<p></span> <span class='kw'>def</span> <span
|
1619
|
-
class='id identifier rubyid_mutt'>mutt</span><span
|
1620
|
-
class='period'>.</span><span class='id identifier
|
1621
|
-
rubyid_fitness='>fitness=</span><span
|
1622
|
-
class='lparen'>(</span><span class='id identifier
|
1623
|
-
rubyid_fit'>fit</span><span
|
1624
|
-
class='rparen'>)</span></p>
|
1625
|
-
|
1626
|
-
<pre> <span class='ivar'>@fitness</span> <span class='op'>=</span> <span class='id identifier rubyid_fit'>fit</span>
|
1627
|
-
<span class='kw'>end</span>
|
1628
|
-
|
1629
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_mutt'>mutt</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span>
|
1630
|
-
<span class='ivar'>@fitness</span>
|
1631
|
-
<span class='kw'>end</span>
|
1632
|
-
|
1633
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:mutt</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='symbol'>:mutt</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1634
|
-
<span class='kw'>end</span>
|
1635
|
-
|
1636
|
-
<span class='comment'># Some convience parms</pre>
|
1637
|
-
|
1638
|
-
<p></span> <span class='id identifier
|
1639
|
-
rubyid_parm'>parm</span> <span
|
1640
|
-
class='op'>=</span> <span
|
1641
|
-
class='ivar'>@controller</span><span
|
1642
|
-
class='period'>.</span><span class='id identifier
|
1643
|
-
rubyid_parms'>parms</span></p>
|
1644
|
-
|
1645
|
-
<pre><span class='comment'># And so now we iterate...</pre>
|
1646
|
-
|
1647
|
-
<p></span> <span
|
1648
|
-
class='ivar'>@critters</span><span
|
1649
|
-
class='period'>.</span><span class='id identifier
|
1650
|
-
rubyid_each'>each</span> <span
|
1651
|
-
class='kw'>do</span> <span
|
1652
|
-
class='op'>|</span><span class='id identifier
|
1653
|
-
rubyid_crit'>crit</span><span
|
1654
|
-
class='op'>|</span></p>
|
1655
|
-
|
1656
|
-
<pre><span class='id identifier rubyid_wearein'>wearein</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1657
|
-
<span class='ivar'>@species</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ck'>ck</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='op'>|</span>
|
1658
|
-
<span class='id identifier rubyid_delta'>delta</span> <span class='op'>=</span> <span class='id identifier rubyid_crit'>crit</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='id identifier rubyid_ck'>ck</span><span class='rparen'>)</span>
|
1659
|
-
<span class='comment'>#log.debug { &quot;delta for #{crit} and #{ck} is #{delta}&quot; }</pre>
|
1660
|
-
|
1661
|
-
<p></span> <span class='kw'>if</span> <span
|
1662
|
-
class='id identifier rubyid_delta'>delta</span> <span
|
1663
|
-
class='op'>&lt;</span> <span class='id
|
1664
|
-
identifier rubyid_parm'>parm</span><span
|
1665
|
-
class='period'>.</span><span class='id identifier
|
1666
|
-
rubyid_compatibility_threshold'>compatibility_threshold</span></p>
|
1667
|
-
|
1668
|
-
<pre> <span class='id identifier rubyid_list'>list</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_crit'>crit</span>
|
1669
|
-
<span class='id identifier rubyid_wearein'>wearein</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1670
|
-
<span class='kw'>break</span>
|
1671
|
-
<span class='kw'>end</span>
|
1672
|
-
<span class='kw'>end</span>
|
1673
|
-
|
1674
|
-
<span class='comment'># New species?</pre>
|
1675
|
-
|
1676
|
-
<p></span> <span class='kw'>unless</span>
|
1677
|
-
<span class='id identifier
|
1678
|
-
rubyid_wearein'>wearein</span></p>
|
1679
|
-
|
1680
|
-
<pre> <span class='ivar'>@species</span><span class='lbracket'>[</span><span class='id identifier rubyid_crit'>crit</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_species'>species</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_crit'>crit</span><span class='rbracket'>]</span>
|
1681
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_species'>species</span><span class='period'>.</span><span class='id identifier rubyid_fitness='>fitness=</span><span class='lparen'>(</span><span class='id identifier rubyid_fit'>fit</span><span class='rparen'>)</span>
|
1682
|
-
<span class='ivar'>@fitness</span> <span class='op'>=</span> <span class='id identifier rubyid_fit'>fit</span>
|
1683
|
-
<span class='kw'>end</span>
|
1684
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_species'>species</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span>
|
1685
|
-
<span class='ivar'>@fitness</span>
|
1686
|
-
<span class='kw'>end</span>
|
1687
|
-
<span class='kw'>end</span>
|
1688
|
-
<span class='kw'>end</span>
|
1689
|
-
|
1690
|
-
<span class='comment'># Compactify the species if less than smallest_species</pre>
|
1691
|
-
|
1692
|
-
<p></span> <span
|
1693
|
-
class='ivar'>@species</span><span
|
1694
|
-
class='period'>.</span><span class='id identifier
|
1695
|
-
rubyid_compactify!'>compactify!</span> <span class='id
|
1696
|
-
identifier rubyid_parm'>parm</span></p>
|
1697
|
-
|
1698
|
-
<pre><span class='comment'># And now we evaluate all species for fitness...</pre>
|
1699
|
-
|
1700
|
-
<p></span> <span
|
1701
|
-
class='ivar'>@species</span><span
|
1702
|
-
class='period'>.</span><span class='id identifier
|
1703
|
-
rubyid_evaluate!'>evaluate!</span></p>
|
1704
|
-
|
1705
|
-
<pre><span class='comment'># Dump for debugging reasons</pre>
|
1706
|
-
|
1707
|
-
<p></span> <span
|
1708
|
-
class='ivar'>@species</span><span
|
1709
|
-
class='period'>.</span><span class='id identifier
|
1710
|
-
rubyid_each'>each</span> <span
|
1711
|
-
class='kw'>do</span> <span
|
1712
|
-
class='op'>|</span><span class='id identifier
|
1713
|
-
rubyid_k'>k</span><span
|
1714
|
-
class='comma'>,</span> <span class='id identifier
|
1715
|
-
rubyid_sp'>sp</span><span
|
1716
|
-
class='op'>|</span></p>
|
1717
|
-
|
1718
|
-
<pre> <span class='id identifier rubyid_log'>log</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;&gt; Species </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'> has </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'> members with a </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sp'>sp</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='embexpr_end'>}</span><span class='tstring_content'> fitness</span><span class='tstring_end'>&quot;</span></span>
|
1719
|
-
<span class='kw'>end</span></pre>
|
1720
|
-
|
1721
|
-
<p><span class='kw'>end</span></pre></p>
|
1722
|
-
|
1723
|
-
<pre> </td>
|
1724
|
-
</tr></pre>
|
1725
|
-
|
1726
|
-
<p></table> </div></p>
|
1727
|
-
|
1728
|
-
<pre> <div class="method_details ">
|
1729
|
-
<h3 class="signature " id="worst_critter-instance_method">
|
1730
|
-
|
1731
|
-
- (<tt>Object</tt>) <strong>worst_critter</strong></pre>
|
1732
|
-
|
1733
|
-
<p></h3><div class=“docstring”></p>
|
1734
|
-
|
1735
|
-
<pre><div class="discussion"></pre>
|
1736
|
-
|
1737
|
-
<p><p>The “worst critter” is the critter with the highest (away from
|
1738
|
-
zero) fitness rating.</p></p>
|
1739
|
-
|
1740
|
-
<pre></div></pre>
|
1741
|
-
|
1742
|
-
<p></div> <div class=“tags”></p>
|
1743
|
-
|
1744
|
-
<p></div><table class=“source_code”></p>
|
1745
|
-
|
1746
|
-
<pre><tr>
|
1747
|
-
<td>
|
1748
|
-
<pre class="lines"></pre>
|
1749
|
-
|
1750
|
-
<p>186 187 188 189 190 191 192</pre></p>
|
1751
|
-
|
1752
|
-
<pre></td>
|
1753
|
-
<td>
|
1754
|
-
<pre class="code"><span class="info file"># File 'lib/rubyneat/population.rb', line 186</span></pre>
|
1755
|
-
|
1756
|
-
<p><span class='kw'>def</span> <span class='id
|
1757
|
-
identifier rubyid_worst_critter'>worst_critter</span></p>
|
1758
|
-
|
1759
|
-
<pre><span class='kw'>unless</span> <span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_compare_func'>compare_func</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1760
|
-
<span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='ivar'>@controller</span><span class='period'>.</span><span class='id identifier rubyid_compare_func'>compare_func</span><span class='period'>.</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1761
|
-
<span class='kw'>else</span>
|
1762
|
-
<span class='ivar'>@critters</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span> <span class='op'>&lt;=&gt;</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_fitness'>fitness</span><span class='rbrace'>}</span>
|
1763
|
-
<span class='kw'>end</span></pre>
|
1764
|
-
|
1765
|
-
<p><span class='kw'>end</span></pre></p>
|
1766
|
-
|
1767
|
-
<pre> </td>
|
1768
|
-
</tr></pre>
|
1769
|
-
|
1770
|
-
<p></table> </div></p>
|
1771
|
-
|
1772
|
-
<pre></div></pre>
|
1773
|
-
|
1774
|
-
<p></div></p>
|
1775
|
-
|
1776
|
-
<pre> <div id="footer">
|
1777
|
-
Generated on Sun Mar 16 16:36:52 2014 by
|
1778
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1779
|
-
0.8.7.3 (ruby-2.1.1).</pre>
|
1780
|
-
|
1781
|
-
<p></div></p>
|
1782
|
-
|
1783
|
-
<pre></body></pre>
|
1784
|
-
|
1785
|
-
<p></html></p>
|
1786
|
-
</main>
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
<footer id="validator-badges" role="contentinfo">
|
1791
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1792
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
1793
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1794
|
-
</footer>
|
1795
|
-
|