evolvable 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +4 -0
  3. data/CHANGELOG.md +37 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +38 -2
  6. data/README.md +227 -290
  7. data/README_YARD.md +237 -0
  8. data/bin/console +18 -5
  9. data/evolvable.gemspec +2 -0
  10. data/examples/ascii_art.rb +62 -0
  11. data/examples/ascii_gene.rb +9 -0
  12. data/examples/hello_world.rb +91 -0
  13. data/examples/images/diagram.png +0 -0
  14. data/examples/stickman.rb +77 -0
  15. data/exe/hello +16 -0
  16. data/lib/evolvable/count_gene.rb +42 -0
  17. data/lib/evolvable/equalize_goal.rb +29 -0
  18. data/lib/evolvable/evaluation.rb +29 -6
  19. data/lib/evolvable/evolution.rb +38 -6
  20. data/lib/evolvable/gene.rb +47 -5
  21. data/lib/evolvable/gene_combination.rb +69 -0
  22. data/lib/evolvable/genome.rb +86 -0
  23. data/lib/evolvable/goal.rb +36 -3
  24. data/lib/evolvable/maximize_goal.rb +30 -0
  25. data/lib/evolvable/minimize_goal.rb +29 -0
  26. data/lib/evolvable/mutation.rb +66 -14
  27. data/lib/evolvable/point_crossover.rb +33 -19
  28. data/lib/evolvable/population.rb +171 -31
  29. data/lib/evolvable/rigid_count_gene.rb +17 -0
  30. data/lib/evolvable/search_space.rb +181 -0
  31. data/lib/evolvable/selection.rb +28 -1
  32. data/lib/evolvable/serializer.rb +21 -0
  33. data/lib/evolvable/uniform_crossover.rb +28 -8
  34. data/lib/evolvable/version.rb +1 -1
  35. data/lib/evolvable.rb +191 -31
  36. metadata +49 -10
  37. data/examples/evolvable_string/char_gene.rb +0 -9
  38. data/examples/evolvable_string.rb +0 -32
  39. data/lib/evolvable/gene_crossover.rb +0 -28
  40. data/lib/evolvable/gene_space.rb +0 -40
  41. data/lib/evolvable/goal/equalize.rb +0 -19
  42. data/lib/evolvable/goal/maximize.rb +0 -19
  43. data/lib/evolvable/goal/minimize.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c195de2ae7f05536ffa76f552733db479904aee34b83675624b1c68a4eba4128
4
- data.tar.gz: fdca723c15870b73dce8aed5914f5d90d77d94a833ac0486ea929e41c31b63ef
3
+ metadata.gz: 145d256bfb7b28668a14cab664de8dabc2e0bfe8bbfa4c2301e9c1aaae843cf2
4
+ data.tar.gz: ce722823a53c91a053657d2bc990372de614b7236390ddc27ac88571932f5a5f
5
5
  SHA512:
6
- metadata.gz: d4d9a4480c240285771f649462aa454444f37c35ef281df77d22902dba2725c620c8f63f0c5abb82ca2a3cf5ba023bb31b73b3b9491dcf66268abcd37f614e21
7
- data.tar.gz: 24ab6bea46ec3eeaf555c1cdb02949a8be3177244430faa8232ae594e42b15f8a2015c3eff2013aa460f0f9b39777e058afc762b3ef41a55ae35574445670d68
6
+ metadata.gz: d68b7d03481e1ff1a3dce744dd98075bfd2567f24acddb5a770c1ae7acd737fd99c32f3f3434381d47bc2a54e5dd4047e822be12cf5f1bcd3e79f6f7b71cc698
7
+ data.tar.gz: 2c9fd505b36a76dc6f25dfa3a70d58e6387ab3689716b29bfbfd5291649b9de2f160609f1192e9843fe9c4dd54759350924e8e442ae4d49728cff87510b5c518
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --plugin readme
2
+ --markup markdown
3
+
4
+ lib/**/*.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  ## Unreleased
2
2
 
3
+ Features
4
+ * Updated documentation.
5
+ * Genome abstraction for genes. [69afd7c](https://github.com/mattruzicka/evolvable/commit/69afd7c957cbf89cc03b4f3f0ba967bf571c34c5)
6
+ * Built-in support for count genes. [69afd7c](https://github.com/mattruzicka/evolvable/commit/69afd7c957cbf89cc03b4f3f0ba967bf571c34c5)
7
+ * Add serializer for dumping and loading for population and genogenome objects [9d2a42a](https://github.com/mattruzicka/evolvable/commit/9d2a42a29103e1525b3c5471578ee97baeb6e8c6)
8
+ * Keep previous generation parents for generating evolvables for the current generation whenever [856ac3a](https://github.com/mattruzicka/evolvable/commit/856ac3a778106d34221ce8ce8ae14b963877dc76)
9
+ * Add #new_evolvables methods to Evolvable Selection, Crossover, and Mutation for acting on evolvables [856ac3a](https://github.com/mattruzicka/evolvable/commit/856ac3a778106d34221ce8ce8ae14b963877dc76)
10
+ * Add EvolvablePopulation#reset_evolvables [b61cccb](https://github.com/mattruzicka/evolvable/commit/b61cccbee8ac8cc9f00496e5461131bb796af974)
11
+ * Improve gene class lookup. Suppose you have an evolvable Dog class with a Dog::TailGene class. Now you can just pass 'TailGene' as the 'type' in your gene space definition [079dcef](https://github.com/mattruzicka/evolvable/commit/079dcef000e57553db8c6e5b89207d2d8e5c9890)
12
+ * Allow Evolvable.search_space to return a hash, array (when only one gene type), or array of arrays [be56c9c](https://github.com/mattruzicka/evolvable/commit/be56c9cc73c7202abc4588cb20c340d1e49498ed)
13
+ * Add Evolvable.search_spaces method which can be defined instead of or in addition to Evolvable.search_space, as an array of search space definitions (configs or Evolvable::SearchSpace objects) [a3c3896](https://github.com/mattruzicka/evolvable/commit/a3c3896d8b1799b7fac6143812a5ef630f716d85)
14
+ * Add ability to inititalize evaluation, selection, combination, and mutation objects with a hash of parameters or object. [7c8fd58](https://github.com/mattruzicka/evolvable/commit/7c8fd586ec882f35e5ce35c5bc6a28982e4d0640)
15
+ * Add the following delegated methods to Evolvable::Population to change the default evolutionary parameters [ffb9998](https://github.com/mattruzicka/evolvable/commit/ffb9998b09f02fa6759322c324b2f448fd3af223)
16
+
17
+ ```
18
+ selection_size
19
+ selection_size=
20
+ mutation_rate
21
+ mutation_rate=
22
+ mutation_probability
23
+ mutation_probability=
24
+ ```
25
+
26
+
27
+ Changes
28
+ * Renamed Goal classes. The old, namespaced goal classes will be removed in version 2.0 [a3fb191](https://github.com/mattruzicka/evolvable/commit/a3fb1915230cc297e545d873a80f0324bca5833d)
29
+ * Renamed Evolvable#population_index to generation_index. The The population_index method will be removed in version 2.0 [e0251f7](https://github.com/mattruzicka/evolvable/commit/e0251f7c51818c30986d5a9a2b44f3834107ec55)
30
+ * Renamed evolvable_class keyword arg in Evolvable::Population#initialize to evolvable_type and suport strings and classes as arguments. Passing evolvable_class is deprecated and will be removed in version 2.0 and at that time the evolvable_tyoe keyword arg will be required [1491f4b](https://github.com/mattruzicka/evolvable/commit/1491f4b6f5bb615ae17e749922a852edce48072b)
31
+ * Renamed Evolvable::Population#new_instance to #new_evolvable + use the previous generation's parents to generate a new instance, if there is one. Otherwise, it continues to randomly intitialize the instances from the defined gene space.
32
+ * Renamed Evolvable#new_instance to #new_evolvable, .initialize_instance to .initialize_evolvable, and #initialize_instance to #after_initialize.
33
+ * Renamed "instance" and "instances" to "evolvable" and "evolvables" across the code base and API.
34
+ * Renamed Evolvable::GeneSpace to Evolvable::SearchSpace. Using Evolvable::GeneSpace and Evolvable.gene_space is deprecated and support will be removed in version 2.0 [837322a](https://github.com/mattruzicka/evolvable/commit/837322a66c87d6b3fdf992c1b6c7e1b2fb920fe7)
35
+ * Renamed Evolution#crossover to Evolution#combination. Using Evolution#crossover is deprecated and support will be removed in version 2.0 [7fad505](https://github.com/mattruzicka/evolvable/commit/7fad505a6dbc679412d5c0565d64791a6edad6b7)
36
+ * Renamed Population#crossover, crossover= to combination [d2190c5](https://github.com/mattruzicka/evolvable/commit/d2190c5b32584a95e25c40a30b685e634a1b6b7f)
37
+ * Renamed Gene.crossover to Gene.combine. Gene.crossover is deprecated and support will be removedin version 2.0 [ed2190c5](https://github.com/mattruzicka/evolvable/commit/ed2190c5b32584a95e25c40a30b685e634a1b6b7f)
38
+
39
+
3
40
  ## 1.0.2 - 2021-04-04
4
41
 
5
42
  Features
data/Gemfile CHANGED
@@ -3,3 +3,6 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ gem 'byebug'
8
+ gem 'readme_yard', path: '/Users/matt/Code/readme_yard'
data/Gemfile.lock CHANGED
@@ -1,11 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- evolvable (1.0.1)
4
+ evolvable (1.1.0)
5
+
6
+ PATH
7
+ remote: /Users/matt/Code/readme_yard
8
+ specs:
9
+ readme_yard (0.2.0)
10
+ tty-markdown (~> 0.7)
11
+ yard-readme (~> 0.3)
5
12
 
6
13
  GEM
7
14
  remote: https://rubygems.org/
8
15
  specs:
16
+ byebug (11.1.3)
17
+ kramdown (2.3.1)
18
+ rexml
19
+ pastel (0.8.0)
20
+ tty-color (~> 0.5)
21
+ rexml (3.2.5)
22
+ rouge (3.26.0)
23
+ strings (0.2.1)
24
+ strings-ansi (~> 0.2)
25
+ unicode-display_width (>= 1.5, < 3.0)
26
+ unicode_utils (~> 1.4)
27
+ strings-ansi (0.2.0)
28
+ tty-color (0.6.0)
29
+ tty-markdown (0.7.0)
30
+ kramdown (>= 1.16.2, < 3.0)
31
+ pastel (~> 0.8)
32
+ rouge (~> 3.14)
33
+ strings (~> 0.2.0)
34
+ tty-color (~> 0.5)
35
+ tty-screen (~> 0.8)
36
+ tty-screen (0.8.1)
37
+ unicode-display_width (2.0.0)
38
+ unicode_utils (1.4.0)
39
+ yard (0.9.26)
40
+ yard-readme (0.3.0)
41
+ yard (~> 0.9.26)
9
42
 
10
43
  PLATFORMS
11
44
  ruby
@@ -13,7 +46,10 @@ PLATFORMS
13
46
 
14
47
  DEPENDENCIES
15
48
  bundler (~> 2.0)
49
+ byebug
16
50
  evolvable!
51
+ readme_yard!
52
+ yard
17
53
 
18
54
  BUNDLED WITH
19
- 2.2.0
55
+ 2.2.15