evolvable 0.1.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.yardopts +4 -0
- data/CHANGELOG.md +63 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +39 -39
- data/LICENSE +21 -0
- data/README.md +234 -248
- data/README_YARD.md +237 -0
- data/bin/console +20 -43
- data/evolvable.gemspec +2 -3
- data/examples/ascii_art.rb +62 -0
- data/examples/ascii_gene.rb +9 -0
- data/examples/hello_world.rb +91 -0
- data/examples/images/diagram.png +0 -0
- data/examples/stickman.rb +77 -0
- data/exe/hello +16 -0
- data/lib/evolvable/count_gene.rb +42 -0
- data/lib/evolvable/equalize_goal.rb +29 -0
- data/lib/evolvable/error/undefined_method.rb +7 -0
- data/lib/evolvable/evaluation.rb +74 -0
- data/lib/evolvable/evolution.rb +58 -0
- data/lib/evolvable/gene.rb +67 -0
- data/lib/evolvable/gene_combination.rb +69 -0
- data/lib/evolvable/genome.rb +86 -0
- data/lib/evolvable/goal.rb +52 -0
- data/lib/evolvable/maximize_goal.rb +30 -0
- data/lib/evolvable/minimize_goal.rb +29 -0
- data/lib/evolvable/mutation.rb +71 -42
- data/lib/evolvable/point_crossover.rb +71 -0
- data/lib/evolvable/population.rb +202 -83
- data/lib/evolvable/rigid_count_gene.rb +17 -0
- data/lib/evolvable/search_space.rb +181 -0
- data/lib/evolvable/selection.rb +45 -0
- data/lib/evolvable/serializer.rb +21 -0
- data/lib/evolvable/uniform_crossover.rb +42 -0
- data/lib/evolvable/version.rb +1 -1
- data/lib/evolvable.rb +203 -56
- metadata +46 -24
- data/.rubocop.yml +0 -20
- data/lib/evolvable/crossover.rb +0 -35
- data/lib/evolvable/errors/not_implemented.rb +0 -5
- data/lib/evolvable/helper_methods.rb +0 -45
- data/lib/evolvable/hooks.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 145d256bfb7b28668a14cab664de8dabc2e0bfe8bbfa4c2301e9c1aaae843cf2
|
4
|
+
data.tar.gz: ce722823a53c91a053657d2bc990372de614b7236390ddc27ac88571932f5a5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d68b7d03481e1ff1a3dce744dd98075bfd2567f24acddb5a770c1ae7acd737fd99c32f3f3434381d47bc2a54e5dd4047e822be12cf5f1bcd3e79f6f7b71cc698
|
7
|
+
data.tar.gz: 2c9fd505b36a76dc6f25dfa3a70d58e6387ab3689716b29bfbfd5291649b9de2f160609f1192e9843fe9c4dd54759350924e8e442ae4d49728cff87510b5c518
|
data/.gitignore
CHANGED
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
## Unreleased
|
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
|
+
|
40
|
+
## 1.0.2 - 2021-04-04
|
41
|
+
|
42
|
+
Features
|
43
|
+
* Make gene_key assignment a class level concern. Makes custom gene initialization simpler. https://github.com/mattruzicka/evolvable/pull/6
|
44
|
+
|
45
|
+
## 1.0.1
|
46
|
+
|
47
|
+
Bug fixes
|
48
|
+
* Fix goal normalization in `Evolvable::Evaluation` when given an object
|
49
|
+
|
50
|
+
## 1.0.0
|
51
|
+
|
52
|
+
Hello 🌎 🌍 🌏
|
53
|
+
|
54
|
+
Check out the [README](https://github.com/mattruzicka/evolvable/blob/master/README.md) for everything
|
55
|
+
|
56
|
+
___
|
57
|
+
|
58
|
+
|
59
|
+
🧬 🧬 🧬
|
60
|
+
|
61
|
+
Please [open an issue](https://github.com/mattruzicka/evolvable/issues/new) if you cannot find what you're looking for
|
62
|
+
|
63
|
+
🧬 🧬 🧬
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
evolvable (
|
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:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
parser (>= 2.5, != 2.5.1.1)
|
36
|
-
powerpack (~> 0.1)
|
37
|
-
rainbow (>= 2.2.2, < 4.0)
|
38
|
-
ruby-progressbar (~> 1.7)
|
39
|
-
unicode-display_width (~> 1.4.0)
|
40
|
-
ruby-progressbar (1.10.0)
|
41
|
-
unicode-display_width (1.4.1)
|
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)
|
42
42
|
|
43
43
|
PLATFORMS
|
44
44
|
ruby
|
45
|
+
x86_64-darwin-18
|
45
46
|
|
46
47
|
DEPENDENCIES
|
47
48
|
bundler (~> 2.0)
|
48
|
-
byebug
|
49
|
+
byebug
|
49
50
|
evolvable!
|
50
|
-
|
51
|
-
|
52
|
-
rubocop (~> 0.64.0)
|
51
|
+
readme_yard!
|
52
|
+
yard
|
53
53
|
|
54
54
|
BUNDLED WITH
|
55
|
-
2.
|
55
|
+
2.2.15
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Matt Ruzicka
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|