evolvable 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +4 -0
- data/CHANGELOG.md +56 -1
- data/Gemfile +3 -0
- data/Gemfile.lock +38 -21
- data/LICENSE +21 -0
- data/README.md +234 -161
- data/README_YARD.md +237 -0
- data/bin/console +18 -5
- data/evolvable.gemspec +2 -2
- 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/evaluation.rb +29 -6
- data/lib/evolvable/evolution.rb +40 -8
- data/lib/evolvable/gene.rb +54 -2
- data/lib/evolvable/gene_combination.rb +73 -0
- data/lib/evolvable/genome.rb +86 -0
- data/lib/evolvable/goal.rb +36 -3
- data/lib/evolvable/maximize_goal.rb +30 -0
- data/lib/evolvable/minimize_goal.rb +29 -0
- data/lib/evolvable/mutation.rb +66 -15
- data/lib/evolvable/point_crossover.rb +33 -19
- data/lib/evolvable/population.rb +171 -31
- data/lib/evolvable/rigid_count_gene.rb +17 -0
- data/lib/evolvable/search_space.rb +181 -0
- data/lib/evolvable/selection.rb +28 -1
- data/lib/evolvable/serializer.rb +21 -0
- data/lib/evolvable/uniform_crossover.rb +28 -8
- data/lib/evolvable/version.rb +1 -1
- data/lib/evolvable.rb +197 -29
- metadata +38 -27
- data/.rubocop.yml +0 -20
- data/examples/evolvable_string/char_gene.rb +0 -9
- data/examples/evolvable_string.rb +0 -32
- data/lib/evolvable/gene_crossover.rb +0 -28
- data/lib/evolvable/gene_space.rb +0 -37
- data/lib/evolvable/goal/equalize.rb +0 -19
- data/lib/evolvable/goal/maximize.rb +0 -19
- data/lib/evolvable/goal/minimize.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '068f9c6690af16e24cb522c25a9a33963bff2f1757dca841858a4baff1f2b777'
|
4
|
+
data.tar.gz: 5d4fbe538753cb309042cf7cec6ded7c3e10d7bace1b8a1d495698be5225114d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49437b455e04a05324091220b215cc99e69576adcd4c8181495cb7ba83d89ed43d0a5743ba3f9264940ea547e2e48790306d3eb03e967a0b3b7f8433eb16479
|
7
|
+
data.tar.gz: a2e2ff86d7c325e718e53ae6edf24665e23ea908d3cd3568cedcd643b473c0d4fa8027d54d7d0c3ae25ee1a1218bedb648440a292c2ca28959bfeed07dfdf316
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,59 @@
|
|
1
|
-
|
1
|
+
## 1.2.0 - 2022-1-22
|
2
|
+
|
3
|
+
* Make it easier to dump and load genomes and use custom serializers. [69afd7c](https://github.com/mattruzicka/evolvable/commit/69afd7c957cbf89cc03b4f3f0ba967bf571c34c5)
|
4
|
+
* Avoid needing Gene#combine implementations to deal with nil args. Technically this could be a breaking change if you have custom combination logic for when two evolvables have different numbers of the same kind of gene and you do something other than just return the gene that isn't nil, but that this is the case seems unlikely, especially considering I'm not even aware of anyone else using this gem in the wild. If you do, please reach out! I'd love to hear from you, even if you're angry about this! [7ae1087](https://github.com/mattruzicka/evolvable/commit/7ae108762505230d81afc79b2f6c3e679fadc1a4)
|
5
|
+
|
6
|
+
|
7
|
+
## 1.1.0 - 2021-12-30
|
8
|
+
|
9
|
+
Features
|
10
|
+
* Updated documentation.
|
11
|
+
* Genome abstraction for genes. [69afd7c](https://github.com/mattruzicka/evolvable/commit/69afd7c957cbf89cc03b4f3f0ba967bf571c34c5)
|
12
|
+
* Built-in support for count genes. [69afd7c](https://github.com/mattruzicka/evolvable/commit/69afd7c957cbf89cc03b4f3f0ba967bf571c34c5)
|
13
|
+
* Add serializer for dumping and loading for population and genogenome objects [9d2a42a](https://github.com/mattruzicka/evolvable/commit/9d2a42a29103e1525b3c5471578ee97baeb6e8c6)
|
14
|
+
* Keep previous generation parents for generating evolvables for the current generation whenever [856ac3a](https://github.com/mattruzicka/evolvable/commit/856ac3a778106d34221ce8ce8ae14b963877dc76)
|
15
|
+
* Add #new_evolvables methods to Evolvable Selection, Crossover, and Mutation for acting on evolvables [856ac3a](https://github.com/mattruzicka/evolvable/commit/856ac3a778106d34221ce8ce8ae14b963877dc76)
|
16
|
+
* Add EvolvablePopulation#reset_evolvables [b61cccb](https://github.com/mattruzicka/evolvable/commit/b61cccbee8ac8cc9f00496e5461131bb796af974)
|
17
|
+
* 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)
|
18
|
+
* 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)
|
19
|
+
* 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)
|
20
|
+
* 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)
|
21
|
+
* Add the following delegated methods to Evolvable::Population to change the default evolutionary parameters [ffb9998](https://github.com/mattruzicka/evolvable/commit/ffb9998b09f02fa6759322c324b2f448fd3af223)
|
22
|
+
|
23
|
+
```
|
24
|
+
selection_size
|
25
|
+
selection_size=
|
26
|
+
mutation_rate
|
27
|
+
mutation_rate=
|
28
|
+
mutation_probability
|
29
|
+
mutation_probability=
|
30
|
+
```
|
31
|
+
|
32
|
+
|
33
|
+
Changes
|
34
|
+
* Renamed Goal classes. The old, namespaced goal classes will be removed in version 2.0 [a3fb191](https://github.com/mattruzicka/evolvable/commit/a3fb1915230cc297e545d873a80f0324bca5833d)
|
35
|
+
* 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)
|
36
|
+
* 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)
|
37
|
+
* 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.
|
38
|
+
* Renamed Evolvable#new_instance to #new_evolvable, .initialize_instance to .initialize_evolvable, and #initialize_instance to #after_initialize.
|
39
|
+
* Renamed "instance" and "instances" to "evolvable" and "evolvables" across the code base and API.
|
40
|
+
* 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)
|
41
|
+
* 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)
|
42
|
+
* Renamed Population#crossover, crossover= to combination [d2190c5](https://github.com/mattruzicka/evolvable/commit/d2190c5b32584a95e25c40a30b685e634a1b6b7f)
|
43
|
+
* 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)
|
44
|
+
|
45
|
+
|
46
|
+
## 1.0.2 - 2021-04-04
|
47
|
+
|
48
|
+
Features
|
49
|
+
* Make gene_key assignment a class level concern. Makes custom gene initialization simpler. https://github.com/mattruzicka/evolvable/pull/6
|
50
|
+
|
51
|
+
## 1.0.1
|
52
|
+
|
53
|
+
Bug fixes
|
54
|
+
* Fix goal normalization in `Evolvable::Evaluation` when given an object
|
55
|
+
|
56
|
+
## 1.0.0
|
2
57
|
|
3
58
|
Hello 🌎 🌍 🌏
|
4
59
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,38 +1,55 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
evolvable (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:
|
9
|
-
ast (2.4.1)
|
10
16
|
byebug (11.1.3)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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)
|
27
42
|
|
28
43
|
PLATFORMS
|
29
44
|
ruby
|
45
|
+
x86_64-darwin-18
|
30
46
|
|
31
47
|
DEPENDENCIES
|
32
48
|
bundler (~> 2.0)
|
33
|
-
byebug
|
49
|
+
byebug
|
34
50
|
evolvable!
|
35
|
-
|
51
|
+
readme_yard!
|
52
|
+
yard
|
36
53
|
|
37
54
|
BUNDLED WITH
|
38
|
-
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.
|