petri_dish_lab 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +48 -81
- data/examples/lazy_dog/README.md +64 -0
- data/examples/{lazy_dog_example.rb → lazy_dog/lazy_dog_example.rb} +8 -8
- data/examples/lazy_dog/log.txt +194 -0
- data/examples/low_poly_reconstruction/README.md +28 -0
- data/examples/low_poly_reconstruction/input_convert.png +0 -0
- data/examples/low_poly_reconstruction/low_poly_reconstruction.rb +176 -0
- data/examples/low_poly_reconstruction/montage.png +0 -0
- data/examples/low_poly_reconstruction/out/gen-0000.png +0 -0
- data/examples/low_poly_reconstruction/out/gen-2473.png +0 -0
- data/examples/low_poly_reconstruction/out/log.txt +2650 -0
- data/examples/low_poly_reconstruction/result.png +0 -0
- data/examples/low_poly_reconstruction/ruby.svg +948 -0
- data/examples/traveling_salesperson/README.md +39 -0
- data/examples/traveling_salesperson/best_member.csv +12 -0
- data/examples/traveling_salesperson/log.txt +113 -0
- data/examples/traveling_salesperson/plot.txt +48 -0
- data/examples/{salesperson_example.rb → traveling_salesperson/salesperson_example.rb} +1 -2
- data/lib/petri_dish/configuration.rb +11 -17
- data/lib/petri_dish/member.rb +2 -2
- data/lib/petri_dish/version.rb +1 -1
- data/lib/petri_dish/world.rb +4 -4
- metadata +19 -5
- data/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dbb45b31999b504330fdc9a0a8b01262e4b32612fa4371b13c9891c5bd7b3e5
|
4
|
+
data.tar.gz: d339ed3aec124c18ba8e20523ad93b4bc3cf2e6a2eeea572f25455d37fb46290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70bda813695301906b7ad1f92a720b30ce8876e1d545f3213b69ce227a58d4be9672e84993861d890972710b857af363a27d65835356e384e18bab0a032e7339
|
7
|
+
data.tar.gz: 2e1648a71dc1cacc7f316cbf4332d6725966e13d73fc9e710f24e6519142b7bbeccd76c03916767ff77d894f8ed65a584d5d2abec0337b18b14efe3c02584f88
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,18 @@
|
|
4
4
|
### Fixed
|
5
5
|
### Removed
|
6
6
|
|
7
|
+
## [0.2.0]
|
8
|
+
### Added
|
9
|
+
- [Documentation] - Each example now has a README file with a description of the problem and the solution
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
- [Configuration] - All `_callback` methods in `Configuration` can now be `nil` (i.e., optional)
|
13
|
+
- [Configuration] - Renamed `Configuration#next_generation_callback` to `Configuration#generation_start_callback`
|
14
|
+
|
15
|
+
### Removed
|
16
|
+
- [Configuration] - Removed `Configuration#target_genes`
|
17
|
+
- [API] - `Member#fitness_function` method is not exposed publicly anymore
|
18
|
+
|
7
19
|
## [0.1.1] - 2023-07-26
|
8
20
|
|
9
21
|
### Added
|
data/README.md
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# Petri Dish - A Ruby library for Evolutionary Algorithms
|
2
2
|
|
3
|
-
>
|
4
|
-
>
|
3
|
+
> [!IMPORTANT]\
|
4
|
+
> The name of the gem is [`petri_dish_lab`](https://rubygems.org/gems/petri_dish_lab), _not_ `petri_dish`.
|
5
5
|
|
6
6
|
## Introduction
|
7
7
|
|
8
|
-
Welcome to Petri Dish, a Ruby library designed to provide
|
8
|
+
Welcome to Petri Dish, a Ruby library designed to provide a flexible interface for implementing evolutionary algorithms. Petri Dish allows you to configure and run your own evolutionary algorithms by providing configurations for genetic material, fitness function, and other parameters. This library is aimed at experimenting with various configurations of evolutionary algorithms and is not meant for production.
|
9
9
|
|
10
10
|
## Overview of Evolutionary Algorithms
|
11
11
|
|
12
|
-
Evolutionary algorithms are a class of optimization algorithms that are inspired by the process of natural evolution. They work by maintaining a population of candidate solutions for
|
12
|
+
Evolutionary algorithms are a class of optimization algorithms that are inspired by the process of natural evolution. They work by maintaining a population of candidate solutions for a specific problem and iteratively evolving that population by applying operations that mimic natural evolution, such as mutation, crossover (or recombination), and selection.
|
13
13
|
|
14
|
-
The
|
14
|
+
The high-level steps of an evolutionary algorithm are:
|
15
15
|
|
16
16
|
1. **Initialization**: Begin with a population of randomly generated individuals.
|
17
17
|
2. **Evaluation**: Compute the fitness of each individual in the population.
|
@@ -29,71 +29,69 @@ Petri Dish is built around a few key classes: `Configuration`, `Member`, `Metada
|
|
29
29
|
|
30
30
|
- `Member`: This class represents an individual in the population. It has a set of genes and a fitness value, which is computed by a fitness function provided in the configuration.
|
31
31
|
|
32
|
-
- `Metadata`: This class keeps track of the evolution process, like the number of generations that have passed and the highest fitness value found so far.
|
32
|
+
- `Metadata`: This class keeps track of the evolution process, like the number of generations that have passed and the highest fitness value found so far. Metadata isn't exposed publically.
|
33
33
|
|
34
|
-
- `World`: This class is responsible for running the evolutionary algorithm. It takes a configuration and a population of members as input, and runs the evolution process until a termination condition is met.
|
34
|
+
- `World`: This class is responsible for running the evolutionary algorithm. It takes a configuration and a population of members as input, and runs the evolution process recursively until a termination condition is met.
|
35
35
|
|
36
36
|
## Configuration
|
37
37
|
|
38
38
|
The `Configuration` class in Petri Dish allows you to customize various aspects of the evolutionary algorithm. Here are the parameters you can set:
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
|
43
|
-
|
44
|
-
| `
|
45
|
-
| `
|
46
|
-
| `
|
47
|
-
| `
|
48
|
-
| `
|
49
|
-
| `
|
50
|
-
| `
|
51
|
-
| `
|
52
|
-
| `
|
53
|
-
| `
|
54
|
-
| `
|
55
|
-
| `
|
56
|
-
| `
|
57
|
-
| `end_condition_function` | A function that determines whether the evolution process should stop premature of `max_generations` | `Proc[Member, bool]` |
|
58
|
-
| `next_generation_callback` | A callback function invoked at the start of each new generation | `Proc[void, void]` |
|
59
|
-
| `end_condition_reached_callback` | A callback function invoked when the end condition is met. It is called with the `Member` which triggered the `end_condition_function` | `Proc[Member, void]` |
|
40
|
+
| Parameter | Description | RBS Type Description |
|
41
|
+
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
42
|
+
| `logger` | An object that responds to `:info` for logging purposes | `Logger` |
|
43
|
+
| `population_size` | The number of individuals in the population | `Integer` |
|
44
|
+
| `mutation_rate` | The chance that a gene will change during mutation (between 0 and 1, inclusive) | `Float` |
|
45
|
+
| `genetic_material` | An array of possible gene values | `Array[untyped]` |
|
46
|
+
| `elitism_rate` | The proportion of the population preserved through elitism (between 0 and 1, inclusive) | `Float` |
|
47
|
+
| `max_generations` | The maximum number of generations to run the evolution for | `Integer` |
|
48
|
+
| `parents_selection_function` | A function used to select parents for crossover | `Proc[Array[Member], Array[Member]]` |
|
49
|
+
| `crossover_function` | A function used to perform crossover between two parents | `Proc[Array[Member], Member]` |
|
50
|
+
| `mutation_function` | A function used to mutate the genes of an individual | `Proc[Member, Member]` |
|
51
|
+
| `fitness_function` | A function used to calculate the fitness of an individual | `Proc[Member, Numeric]` |
|
52
|
+
| `highest_fitness_callback` | A callback function invoked when a new highest fitness is found | `nil | Proc[Member, void]` |
|
53
|
+
| `max_generation_reached_callback` | A callback function invoked when the maximum number of generations is reached | `nil | Proc[void, void]` |
|
54
|
+
| `end_condition_function` | A function that determines whether the evolution process should stop premature of `max_generations` | `nil | Proc[Member, bool]` |
|
55
|
+
| `generation_start_callback` | A callback function invoked at the start of each new generation | `nil | Proc[Integer, void]` |
|
56
|
+
| `end_condition_reached_callback` | A callback function invoked when the end condition is met. It is called with the `Member` which triggered the `end_condition_function` | `nil | Proc[Member, void]` |
|
60
57
|
|
61
58
|
You can create a new `Configuration` object by calling `Configuration.configure` and providing a block:
|
62
59
|
|
63
60
|
```ruby
|
64
61
|
configuration = PetriDish::Configuration.configure do |config|
|
65
|
-
|
62
|
+
config.logger = Logger.new($stdout)
|
63
|
+
config.population_size = 100
|
64
|
+
# ...cont
|
66
65
|
end
|
67
66
|
```
|
68
67
|
|
69
|
-
In the block, you can set the parameters of the configuration to customize the behavior of your evolutionary algorithm.
|
70
|
-
|
71
68
|
## Member
|
72
69
|
|
73
70
|
The `Member` class in Petri Dish represents an individual in the population. Each member has a set of genes and a fitness value, which is calculated by a fitness function provided in the configuration. Here are the parameters and methods you can interact with:
|
74
71
|
|
75
|
-
- `new(genes:, fitness_function:)`: This method is used to create a new member. It takes an array of genes and a fitness function as arguments.
|
76
|
-
|
77
|
-
- `genes` (`Array[untyped]`): The genetic material of the individual, represented as an array
|
78
|
-
|
79
|
-
- `fitness_function
|
72
|
+
- `Member#new(genes:, fitness_function:)`: This method is used to create a new member. It takes an array of genes and a fitness function as arguments.
|
73
|
+
|
74
|
+
- `Member#genes` (`Array[untyped]`): The genetic material of the individual, represented as an array.
|
75
|
+
|
76
|
+
- `Configuration#fitness_function`: (`Proc[Member, Float]`): The function used to calculate the fitness of the individual. It is provided during the initialization of the member.
|
77
|
+
|
78
|
+
- `Member#fitness`: This method calls the provided fitness function. The resulting fitness value is cached after the first calculation and reused in subsequent calls.
|
80
79
|
|
81
|
-
- `fitness`: This method calls the provided fitness function. The resulting fitness value is cached after the first calculation and reused in subsequent calls.
|
82
80
|
|
83
81
|
Here's an example of how to create a new member:
|
84
82
|
|
85
83
|
```ruby
|
86
84
|
member = PetriDish::Member.new(
|
87
|
-
genes: [
|
88
|
-
fitness_function: ->(member) {
|
85
|
+
genes: [1, 1, 0, 1, 0, 1],
|
86
|
+
fitness_function: ->(member) { member.genes.sum }
|
89
87
|
)
|
90
88
|
```
|
91
89
|
|
92
|
-
In this example, `[
|
90
|
+
In this example, `[1, 1, 0, 1, 0, 1]` is the genetic material for the member, and the lambda function is used to calculate the fitness of the member (in this example, we take the sum of the Array).
|
93
91
|
|
94
92
|
## Fitness Function
|
95
93
|
|
96
|
-
|
94
|
+
Modelling a meaningful fitness function is crucial as it provides a way to evaluate how good or "fit" an individual member of the population is in solving the problem at hand. The fitness function is a measure of quality or performance, and it guides the evolutionary algorithm in the search for optimal solutions.
|
97
95
|
|
98
96
|
Here are the necessary technical properties required when defining a fitness function for the Petri Dish framework:
|
99
97
|
|
@@ -105,16 +103,16 @@ Here are the necessary technical properties required when defining a fitness fun
|
|
105
103
|
|
106
104
|
4. Deterministic: Given the same `Member`, the fitness function should always return the same fitness score. This is because the fitness of a member may be evaluated multiple times during the evolutionary process, and inconsistent results could lead to unpredictable behavior.
|
107
105
|
|
108
|
-
5.
|
106
|
+
5. Discriminative: The fitness function should be able to discriminate between different members of the population. That is, members with different genes should have different fitness scores. If many members have the same fitness score, the evolutionary algorithm will have a harder time deciding which members are better.
|
109
107
|
|
110
|
-
6.
|
108
|
+
6. Non-negative: The fitness function should ideally return non-negative values. This isn't a strict requirement, but having non-negative fitness values can make the algorithm easier to understand and debug.
|
111
109
|
|
112
110
|
## Install and Setup
|
113
111
|
|
114
|
-
>
|
115
|
-
> The name of the
|
112
|
+
> [!WARNING]\
|
113
|
+
> The name of the _gem_ is `petri_dish_lab`. \
|
114
|
+
> The name of the _repo_ is `petri_dish`. \
|
116
115
|
> The name of the _module_ is `PetriDish`.
|
117
|
-
> The name of the _gem_ is `petri_dish_lab`.
|
118
116
|
|
119
117
|
You can install `petri_dish_lab` as a gem in your application. Add this line to your application's Gemfile:
|
120
118
|
|
@@ -184,43 +182,12 @@ If you add new code, remember to add corresponding tests and ensure all tests pa
|
|
184
182
|
|
185
183
|
## Examples
|
186
184
|
|
187
|
-
|
188
|
-
|
189
|
-
The `lazy_dog_example.rb` is an example of using the Petri Dish library to solve a simple problem: Evolving a string to match "the quick brown fox jumped over the lazy white dog". This is a classic example of using a genetic algorithm to find a solution to a problem.
|
190
|
-
|
191
|
-
The genetic material in this case is the array of all lowercase letters and space. The target genes are the characters in the target string. The fitness function is defined as the cube of the sum of matches between the genes of a member and the target genes. This means that members with more matching characters will have a much higher fitness.
|
192
|
-
|
193
|
-
The parents for crossover are selected using a tournament selection function which picks the best 2 out of a random sample of 20% of the population. Crossover is performed at a random midpoint in the genes.
|
185
|
+
Several example problems are configured and solved in the `/examples` directory.
|
194
186
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
To run the example, simply execute the following command in your terminal:
|
200
|
-
|
201
|
-
```bash
|
202
|
-
bundle exec ruby examples/lazy_dog_example.rb
|
203
|
-
```
|
204
|
-
|
205
|
-
### Traveling Salesperson Example
|
206
|
-
|
207
|
-
The `salesperson_example.rb` is an example of using the Petri Dish library to solve a more complex problem: The Traveling Salesperson Problem. In this problem, a salesperson needs to visit a number of cities, each at a different location, and return to the starting city. The goal is to find the shortest possible route that visits each city exactly once.
|
208
|
-
|
209
|
-
In this example, each city is represented as a `Gene` object with `x` and `y` coordinates. The genetic material is the array of all possible `x` and `y` coordinates. The fitness function is defined as the inverse of the total distance of the route, which means that shorter routes will have higher fitness.
|
210
|
-
|
211
|
-
The parents for crossover are selected using a tournament selection function which picks the best 2 out of a random sample of 20% of the population. Crossover is performed using an ordered crossover method which maintains the relative order of the genes from both parents.
|
212
|
-
|
213
|
-
Mutation is implemented as a chance to swap two genes in a member. The mutation rate is set to 0.01, which means that on average, 1% of the genes in a member will mutate in each generation.
|
214
|
-
|
215
|
-
The evolutionary process runs for a fixed number of generations, and the highest fitness member in each generation is saved to a CSV file.
|
216
|
-
|
217
|
-
To run the example, simply execute the following command in your terminal:
|
218
|
-
|
219
|
-
```bash
|
220
|
-
bundle exec ruby examples/salesperson_example.rb
|
221
|
-
```
|
187
|
+
- [Lazy Dog](examples/lazy_dog/README.md) - Evolving a string to match "the quick brown fox jumped over the lazy white dog"
|
188
|
+
- [Traveling Salesperson](examples/traveling_salesperson/README.md) - Finding the shortest route that visits each city exactly once
|
189
|
+
- [Low-Poly Image Reconstruction](examples/low_poly_reconstruction/README.md) - Generating a low-poly representation of an image
|
222
190
|
|
223
|
-
You can then visualize the best route using the provided `uplot` command.
|
224
191
|
|
225
192
|
## Resources
|
226
193
|
- [Genetic Algorithms Explained By Example - Youtube](https://www.youtube.com/watch?v=uQj5UNhCPuo)
|
@@ -230,4 +197,4 @@ You can then visualize the best route using the provided `uplot` command.
|
|
230
197
|
- [Tail Call Optimization in Ruby - Blog](https://nithinbekal.com/posts/ruby-tco/)
|
231
198
|
- [Neural network and genetic algorithm based global path planning in a static environment - Paper](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.583.3340&rep=rep1&type=pdf)
|
232
199
|
- [Traveling Salesman Problem using Genetic Algorithm - Blog](https://www.geeksforgeeks.org/traveling-salesman-problem-using-genetic-algorithm/)
|
233
|
-
- [A KNOWLEDGE-BASED GENETIC ALGORITHM FOR PATH PLANNING OF MOBILE ROBOTS - Thesis](https://atrium.lib.uoguelph.ca/xmlui/bitstream/handle/10214/22039/Hu_Yanrong_MSc.pdf?sequence=2)
|
200
|
+
- [A KNOWLEDGE-BASED GENETIC ALGORITHM FOR PATH PLANNING OF MOBILE ROBOTS - Thesis](https://atrium.lib.uoguelph.ca/xmlui/bitstream/handle/10214/22039/Hu_Yanrong_MSc.pdf?sequence=2)
|
@@ -0,0 +1,64 @@
|
|
1
|
+
### Lazy Dog
|
2
|
+
|
3
|
+
```
|
4
|
+
000125 " noq hvqcyuliwenkoocgjjbhzdbkegxtopnukrvbyasmyqdks"
|
5
|
+
000343 "r rawfdrfmjkzwarduuossipzzioeqhxihezwwqmvewiffvdzi"
|
6
|
+
000729 "tcqoorqcwwwdmstufymelutnkvyovga mwopl zjfflahrmiey"
|
7
|
+
001000 "tcqoorqcwwwdmstufymelutngkaovga mwopl zjfflaheovqr"
|
8
|
+
001331 "tcqoorqcwwwdmstufacljcxzgkaovga mwopl zjfflatwpddv"
|
9
|
+
001728 "tcqoorqcwwwdmstufymelutnkvyovga mww wzzscdnitwpddv"
|
10
|
+
002197 "tcqoorqcwwwdmstufymelutnkvyovga mww l zjgf i epdzi"
|
11
|
+
002744 "tcqoouqcwwwdmstufacljcxzgkaovga mww l zjffnitwpddv"
|
12
|
+
003375 "tcqoouqcwwwdmwtufymelutnkvyovga mww l zjfflitwpddv"
|
13
|
+
004096 "tcqoouqcwwwdmstufacljutnkvyovga mww l zscdnitwpddg"
|
14
|
+
004913 "tcqoouqcwwwdmwtufacljutnkvyovga mww l zjfflitwpddg"
|
15
|
+
005832 "tcqoouqcwwwdmstufyxelutnedyovga mww l zscdnitwpddg"
|
16
|
+
006859 "tcqoouqcwwwdmstufyxelutnedyovga mww l zycdnitwpddg"
|
17
|
+
008000 "tcqoouqcwwwdmwnufoxelutneuyovga mww l zscdnitwpddg"
|
18
|
+
009261 "tcqoouqcwwwdmwtufoxelutnedyovga mww l zycdnitwpddg"
|
19
|
+
010648 "tcqoouqcwwwdmwnufyxejutnedyovga mww l zycdnitwpddg"
|
20
|
+
012167 "tcqoouqcwwwdmwnufoxejutnedyovga mww l zycdnitwpddg"
|
21
|
+
013824 "tcqoouqcwwwdmwn foxejutnedyovga mww l zycdnitwpddg"
|
22
|
+
015625 "tcqoouqcwwwdmwn foxejutneddovga mww l zycwnitwpddg"
|
23
|
+
017576 "tcqoouqcwwwdmwn foxejutneddovga mww l zycwnitw ddg"
|
24
|
+
019683 "thqoouqcwwwdmwn foxejutneddovga mww l zycwnitw ddg"
|
25
|
+
021952 "thqoouqcwwwrmwn foxejutnedyovga mww l zycwnitw ddg"
|
26
|
+
024389 "thqoquqcwwwrmwn foxejutnedyovga mww l zycwnitw ddg"
|
27
|
+
027000 "thqoquqcwwwrmwn foxejutnedyovga tww l zycwnitw ddg"
|
28
|
+
029791 "thqoquqcwwarmwn fox jutneddovga tww l zycwnitw ddg"
|
29
|
+
032768 "thqoquqcwwwrmwn fox jumneddovga tww l zycwnitw ddg"
|
30
|
+
035937 "thqoquicwwwrmwn fox jumneddovga tww l zycwnitw ddg"
|
31
|
+
039304 "thqoquicwwwrown fox jumneddovga tww l zycwnitw ddg"
|
32
|
+
042875 "thqoquicwwwrown fox jumneddovga tww l zycwnitw dog"
|
33
|
+
046656 "thqoquicwwbrown fox jumneddovga tww l zycwnitw dog"
|
34
|
+
050653 "thqoquicwwbrown fox jumneddovga tww l zy wnitw dog"
|
35
|
+
054872 "thqoquicwwbrown fox jumned ovga tww l zy wnitw dog"
|
36
|
+
059319 "thq quicwwbrown fox jumned ovga tww l zy wnitw dog"
|
37
|
+
064000 "thq quicwwbrown fox jumned ovea tww l zy wnitw dog"
|
38
|
+
068921 "thq quicwwbrown fox jumped ovea tww l zy wnitw dog"
|
39
|
+
074088 "thq quicwwbrown fox jumped over tww l zy wnitw dog"
|
40
|
+
079507 "thq quicwwbrown fox jumped over tww l zy wnite dog"
|
41
|
+
085184 "thq quicwwbrown fox jumped over tww lazy wnite dog"
|
42
|
+
091125 "thq quicwwbrown fox jumped over twe lazy wnite dog"
|
43
|
+
097336 "the quicwwbrown fox jumped over twe lazy wnite dog"
|
44
|
+
103823 "the quici brown fox jumped over twe lazy wnite dog"
|
45
|
+
110592 "the quick brown fox jumped over twe lazy wnite dog"
|
46
|
+
117649 "the quick brown fox jumped over the lazy wnite dog"
|
47
|
+
125000 "the quick brown fox jumped over the lazy white dog"
|
48
|
+
```
|
49
|
+
|
50
|
+
The `lazy_dog_example.rb` is an example of using the Petri Dish library to solve a simple problem: Evolving a string to match "the quick brown fox jumped over the lazy white dog". This is a classic example of using a genetic algorithm to find a solution to a problem.
|
51
|
+
|
52
|
+
The genetic material in this case is the array of all lowercase letters and space. The target genes are the characters in the target string. The fitness function is defined as the cube of the sum of matches between the genes of a member and the target genes. This means that members with more matching characters will have a much higher fitness.
|
53
|
+
|
54
|
+
The parents for crossover are selected using a tournament selection function which picks the best 2 out of a random sample of 20% of the population. Crossover is performed at a random midpoint in the genes.
|
55
|
+
|
56
|
+
Mutation is implemented as a chance to replace a gene with a random gene from the genetic material. The mutation rate is set to 0.005, which means that on average, 0.5% of the genes in a member will mutate in each generation.
|
57
|
+
|
58
|
+
The end condition for the evolutionary process is when a member with genes exactly matching the target genes is found.
|
59
|
+
|
60
|
+
To run the example, simply execute the following command in your terminal:
|
61
|
+
|
62
|
+
```bash
|
63
|
+
bundle exec ruby examples/lazy_dog_example.rb
|
64
|
+
```
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# require "petri_dish" # Uncomment this line and comment/remove the line below if you're using Petri Dish as a gem
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../lib/petri_dish"
|
3
3
|
|
4
4
|
target_genes = "the quick brown fox jumped over the lazy white dog".chars
|
5
5
|
genetic_material = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", " "]
|
6
6
|
|
7
|
-
def genes_match_target_end_condition_function(
|
7
|
+
def genes_match_target_end_condition_function(target_genes)
|
8
8
|
->(member) do
|
9
|
-
member.genes ==
|
9
|
+
member.genes == target_genes
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -16,9 +16,9 @@ def twenty_percent_tournament_function(configuration)
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def exponential_fitness_function(
|
19
|
+
def exponential_fitness_function(target_genes)
|
20
20
|
->(member) do
|
21
|
-
member.genes.zip(
|
21
|
+
member.genes.zip(target_genes).map do |target_gene, member_gene|
|
22
22
|
(target_gene == member_gene) ? 1 : 0
|
23
23
|
end.sum**3
|
24
24
|
end
|
@@ -45,16 +45,16 @@ def random_mutation_function(configuration)
|
|
45
45
|
end
|
46
46
|
|
47
47
|
configuration = PetriDish::Configuration.configure do |config|
|
48
|
+
config.logger = Logger.new("/dev/null")
|
48
49
|
config.max_generations = 5000
|
49
50
|
config.population_size = 250
|
50
51
|
config.mutation_rate = 0.005
|
51
52
|
config.genetic_material = genetic_material
|
52
|
-
config.target_genes = target_genes
|
53
53
|
config.parents_selection_function = twenty_percent_tournament_function(config)
|
54
|
-
config.fitness_function = exponential_fitness_function(
|
54
|
+
config.fitness_function = exponential_fitness_function(target_genes)
|
55
55
|
config.crossover_function = random_midpoint_crossover_function(config)
|
56
56
|
config.mutation_function = random_mutation_function(config)
|
57
|
-
config.end_condition_function = genes_match_target_end_condition_function(
|
57
|
+
config.end_condition_function = genes_match_target_end_condition_function(target_genes)
|
58
58
|
config.highest_fitness_callback = ->(member) { puts "Highest fitness: #{member.fitness} (#{member})" }
|
59
59
|
end
|
60
60
|
|
@@ -0,0 +1,194 @@
|
|
1
|
+
I, [2023-07-30T01:12:22.091277 #3193] INFO -- : Run started.
|
2
|
+
I, [2023-07-30T01:12:22.091345 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":0,"highest_fitness":0,"elapsed_time":0.0,"last_fitness_increase":0}
|
3
|
+
Highest fitness: 125 (frzwpkkjdmylowlznuvqrooipxlgvfwjmjgn avcdckktvtbgl)
|
4
|
+
I, [2023-07-30T01:12:22.093669 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":0,"highest_fitness":125,"elapsed_time":0.0,"last_fitness_increase":0}
|
5
|
+
Highest fitness: 343 (qkkgq riiekcnwflqwmnmqgbernbeerdseqhhxzopvhzilkax )
|
6
|
+
I, [2023-07-30T01:12:22.093717 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":0,"highest_fitness":343,"elapsed_time":0.0,"last_fitness_increase":0}
|
7
|
+
Highest fitness: 512 (npfobknlonwef slikvmjciifg zvmzgbhelqsky dhwbartys)
|
8
|
+
I, [2023-07-30T01:12:22.093840 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":0,"highest_fitness":512,"elapsed_time":0.0,"last_fitness_increase":0}
|
9
|
+
Highest fitness: 729 (qkkgq riiekcnwflqwmnmqgbernbeerdcde rivyvndfhrnzon)
|
10
|
+
I, [2023-07-30T01:12:22.096506 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":0,"highest_fitness":729,"elapsed_time":0.01,"last_fitness_increase":0}
|
11
|
+
I, [2023-07-30T01:12:22.099678 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":1,"highest_fitness":729,"elapsed_time":0.01,"last_fitness_increase":0}
|
12
|
+
Highest fitness: 1000 (qkkgq riiekcnwflqwmnmqgbernbeer cde rivyvnwfhrnzon)
|
13
|
+
I, [2023-07-30T01:12:22.100329 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":1,"highest_fitness":1000,"elapsed_time":0.01,"last_fitness_increase":1}
|
14
|
+
Highest fitness: 1331 (qkkgq riiekcnwflqwmnmqgbernbeerdcde yavy dhwbartys)
|
15
|
+
I, [2023-07-30T01:12:22.103838 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":1,"highest_fitness":1331,"elapsed_time":0.01,"last_fitness_increase":1}
|
16
|
+
I, [2023-07-30T01:12:22.105341 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":2,"highest_fitness":1331,"elapsed_time":0.01,"last_fitness_increase":1}
|
17
|
+
Highest fitness: 1728 (qkkgq riiekcnwflqwmnmqgbernbeer cde ravy dhwbartys)
|
18
|
+
I, [2023-07-30T01:12:22.106385 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":2,"highest_fitness":1728,"elapsed_time":0.02,"last_fitness_increase":2}
|
19
|
+
Highest fitness: 2197 (qkkgq riiekcnwflqwmnmqgbernbeerdcde yavy dhwtetoqs)
|
20
|
+
I, [2023-07-30T01:12:22.108487 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":2,"highest_fitness":2197,"elapsed_time":0.02,"last_fitness_increase":2}
|
21
|
+
I, [2023-07-30T01:12:22.112715 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":3,"highest_fitness":2197,"elapsed_time":0.02,"last_fitness_increase":2}
|
22
|
+
Highest fitness: 2744 (qkkgq riiekcnwflqwmnmqgbernbeerdcde yavy dhwtedtot)
|
23
|
+
I, [2023-07-30T01:12:22.112988 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":3,"highest_fitness":2744,"elapsed_time":0.02,"last_fitness_increase":3}
|
24
|
+
I, [2023-07-30T01:12:22.118215 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":4,"highest_fitness":2744,"elapsed_time":0.03,"last_fitness_increase":3}
|
25
|
+
Highest fitness: 4096 (lcdwqh wfifri slikvmjciifg tverdcde yavy dhwtedtot)
|
26
|
+
I, [2023-07-30T01:12:22.118650 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":4,"highest_fitness":4096,"elapsed_time":0.03,"last_fitness_increase":4}
|
27
|
+
I, [2023-07-30T01:12:22.123786 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":5,"highest_fitness":4096,"elapsed_time":0.03,"last_fitness_increase":4}
|
28
|
+
I, [2023-07-30T01:12:22.129645 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":6,"highest_fitness":4096,"elapsed_time":0.04,"last_fitness_increase":4}
|
29
|
+
Highest fitness: 4913 (lcdwqu wfifri slikvmjciifg tverdcde yavy dhwterzon)
|
30
|
+
I, [2023-07-30T01:12:22.130801 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":6,"highest_fitness":4913,"elapsed_time":0.04,"last_fitness_increase":6}
|
31
|
+
I, [2023-07-30T01:12:22.135309 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":7,"highest_fitness":4913,"elapsed_time":0.04,"last_fitness_increase":6}
|
32
|
+
Highest fitness: 5832 (lcdwqu wfifri slikvmjcipfg tverdcde yavy dhwtedtot)
|
33
|
+
I, [2023-07-30T01:12:22.135978 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":7,"highest_fitness":5832,"elapsed_time":0.04,"last_fitness_increase":7}
|
34
|
+
I, [2023-07-30T01:12:22.141220 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":8,"highest_fitness":5832,"elapsed_time":0.05,"last_fitness_increase":7}
|
35
|
+
Highest fitness: 6859 (lcdwqu wflfri slikvmjciber tver cde ravy dhwterzon)
|
36
|
+
I, [2023-07-30T01:12:22.141638 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":8,"highest_fitness":6859,"elapsed_time":0.05,"last_fitness_increase":8}
|
37
|
+
I, [2023-07-30T01:12:22.146748 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":9,"highest_fitness":6859,"elapsed_time":0.06,"last_fitness_increase":8}
|
38
|
+
Highest fitness: 8000 (lcdwqu wfzfri sliovmjcibeg tver cde ravy dhwterzon)
|
39
|
+
I, [2023-07-30T01:12:22.147781 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":9,"highest_fitness":8000,"elapsed_time":0.06,"last_fitness_increase":9}
|
40
|
+
I, [2023-07-30T01:12:22.154909 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":10,"highest_fitness":8000,"elapsed_time":0.06,"last_fitness_increase":9}
|
41
|
+
Highest fitness: 9261 (lcdwquiwfzfri sliovmjcibeg tver cde ravy dhwterzon)
|
42
|
+
I, [2023-07-30T01:12:22.159993 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":10,"highest_fitness":9261,"elapsed_time":0.07,"last_fitness_increase":10}
|
43
|
+
I, [2023-07-30T01:12:22.160537 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":11,"highest_fitness":9261,"elapsed_time":0.07,"last_fitness_increase":10}
|
44
|
+
I, [2023-07-30T01:12:22.166475 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":12,"highest_fitness":9261,"elapsed_time":0.08,"last_fitness_increase":10}
|
45
|
+
Highest fitness: 10648 (lcdwquiwfzfri sliov jcibeg tver cde ravy dhwterzon)
|
46
|
+
I, [2023-07-30T01:12:22.167101 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":12,"highest_fitness":10648,"elapsed_time":0.08,"last_fitness_increase":12}
|
47
|
+
I, [2023-07-30T01:12:22.172147 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":13,"highest_fitness":10648,"elapsed_time":0.08,"last_fitness_increase":12}
|
48
|
+
Highest fitness: 12167 (lcewquiwfzfri sliovmjgipeg tver cde ravy dhwterzon)
|
49
|
+
I, [2023-07-30T01:12:22.172773 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":13,"highest_fitness":12167,"elapsed_time":0.08,"last_fitness_increase":13}
|
50
|
+
I, [2023-07-30T01:12:22.178224 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":14,"highest_fitness":12167,"elapsed_time":0.09,"last_fitness_increase":13}
|
51
|
+
Highest fitness: 13824 (lcewquiwfzfri sliov jcipeg tver cde ravy dhwterzon)
|
52
|
+
I, [2023-07-30T01:12:22.178699 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":14,"highest_fitness":13824,"elapsed_time":0.09,"last_fitness_increase":14}
|
53
|
+
I, [2023-07-30T01:12:22.184000 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":15,"highest_fitness":13824,"elapsed_time":0.09,"last_fitness_increase":14}
|
54
|
+
Highest fitness: 15625 (lcewquiwfzfri sliov jcipeg tver cde ravy dhiterzon)
|
55
|
+
I, [2023-07-30T01:12:22.184364 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":15,"highest_fitness":15625,"elapsed_time":0.09,"last_fitness_increase":15}
|
56
|
+
I, [2023-07-30T01:12:22.189991 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":16,"highest_fitness":15625,"elapsed_time":0.1,"last_fitness_increase":15}
|
57
|
+
Highest fitness: 17576 (lcewquiwfzfri sl ov jcipeg tver cde razy dhiterzon)
|
58
|
+
I, [2023-07-30T01:12:22.190672 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":16,"highest_fitness":17576,"elapsed_time":0.1,"last_fitness_increase":16}
|
59
|
+
I, [2023-07-30T01:12:22.196044 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":17,"highest_fitness":17576,"elapsed_time":0.1,"last_fitness_increase":16}
|
60
|
+
Highest fitness: 19683 (ccewquiwfzfri nliov jcipeg wver tde ravy dhiterzon)
|
61
|
+
I, [2023-07-30T01:12:22.196754 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":17,"highest_fitness":19683,"elapsed_time":0.11,"last_fitness_increase":17}
|
62
|
+
I, [2023-07-30T01:12:22.201594 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":18,"highest_fitness":19683,"elapsed_time":0.11,"last_fitness_increase":17}
|
63
|
+
Highest fitness: 21952 (ccewquiwfzfri nliov jcipeg wver tde razy dhiterzon)
|
64
|
+
I, [2023-07-30T01:12:22.201980 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":18,"highest_fitness":21952,"elapsed_time":0.11,"last_fitness_increase":18}
|
65
|
+
I, [2023-07-30T01:12:22.210556 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":19,"highest_fitness":21952,"elapsed_time":0.12,"last_fitness_increase":18}
|
66
|
+
I, [2023-07-30T01:12:22.216166 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":20,"highest_fitness":21952,"elapsed_time":0.12,"last_fitness_increase":18}
|
67
|
+
Highest fitness: 24389 (ccewquiwfzfri nliov jcmpeg wver tde razy dhiterzon)
|
68
|
+
I, [2023-07-30T01:12:22.217913 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":20,"highest_fitness":24389,"elapsed_time":0.13,"last_fitness_increase":20}
|
69
|
+
I, [2023-07-30T01:12:22.221967 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":21,"highest_fitness":24389,"elapsed_time":0.13,"last_fitness_increase":20}
|
70
|
+
Highest fitness: 27000 (ccewquiwfzfri nliov jcmpeg wver tde razy dhiterdon)
|
71
|
+
I, [2023-07-30T01:12:22.222789 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":21,"highest_fitness":27000,"elapsed_time":0.13,"last_fitness_increase":21}
|
72
|
+
I, [2023-07-30T01:12:22.227575 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":22,"highest_fitness":27000,"elapsed_time":0.14,"last_fitness_increase":21}
|
73
|
+
I, [2023-07-30T01:12:22.233469 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":23,"highest_fitness":27000,"elapsed_time":0.14,"last_fitness_increase":21}
|
74
|
+
Highest fitness: 29791 (ccewquiwfzfri nliov jcmpeg over tde razy dhiterdox)
|
75
|
+
I, [2023-07-30T01:12:22.233861 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":23,"highest_fitness":29791,"elapsed_time":0.14,"last_fitness_increase":23}
|
76
|
+
I, [2023-07-30T01:12:22.238948 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":24,"highest_fitness":29791,"elapsed_time":0.15,"last_fitness_increase":23}
|
77
|
+
Highest fitness: 32768 (cce quiwfzfri nliov jcmpeg over tde razy dhiterdox)
|
78
|
+
I, [2023-07-30T01:12:22.240912 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":24,"highest_fitness":32768,"elapsed_time":0.15,"last_fitness_increase":24}
|
79
|
+
I, [2023-07-30T01:12:22.244487 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":25,"highest_fitness":32768,"elapsed_time":0.15,"last_fitness_increase":24}
|
80
|
+
I, [2023-07-30T01:12:22.250402 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":26,"highest_fitness":32768,"elapsed_time":0.16,"last_fitness_increase":24}
|
81
|
+
Highest fitness: 35937 (cce quiwfzfri nliov jcmpeg over tde razy dhiterdog)
|
82
|
+
I, [2023-07-30T01:12:22.254894 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":26,"highest_fitness":35937,"elapsed_time":0.16,"last_fitness_increase":26}
|
83
|
+
I, [2023-07-30T01:12:22.255873 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":27,"highest_fitness":35937,"elapsed_time":0.16,"last_fitness_increase":26}
|
84
|
+
I, [2023-07-30T01:12:22.262120 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":28,"highest_fitness":35937,"elapsed_time":0.17,"last_fitness_increase":26}
|
85
|
+
I, [2023-07-30T01:12:22.267740 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":29,"highest_fitness":35937,"elapsed_time":0.18,"last_fitness_increase":26}
|
86
|
+
I, [2023-07-30T01:12:22.273238 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":30,"highest_fitness":35937,"elapsed_time":0.18,"last_fitness_increase":26}
|
87
|
+
I, [2023-07-30T01:12:22.279191 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":31,"highest_fitness":35937,"elapsed_time":0.19,"last_fitness_increase":26}
|
88
|
+
I, [2023-07-30T01:12:22.290059 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":32,"highest_fitness":35937,"elapsed_time":0.2,"last_fitness_increase":26}
|
89
|
+
I, [2023-07-30T01:12:22.296655 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":33,"highest_fitness":35937,"elapsed_time":0.21,"last_fitness_increase":26}
|
90
|
+
I, [2023-07-30T01:12:22.302554 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":34,"highest_fitness":35937,"elapsed_time":0.21,"last_fitness_increase":26}
|
91
|
+
Highest fitness: 39304 (cce quicfzfriwnliov jcmpeg over tde razy dhiterdox)
|
92
|
+
I, [2023-07-30T01:12:22.305882 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":34,"highest_fitness":39304,"elapsed_time":0.21,"last_fitness_increase":34}
|
93
|
+
I, [2023-07-30T01:12:22.308815 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":35,"highest_fitness":39304,"elapsed_time":0.22,"last_fitness_increase":34}
|
94
|
+
I, [2023-07-30T01:12:22.315809 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":36,"highest_fitness":39304,"elapsed_time":0.22,"last_fitness_increase":34}
|
95
|
+
I, [2023-07-30T01:12:22.323678 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":37,"highest_fitness":39304,"elapsed_time":0.23,"last_fitness_increase":34}
|
96
|
+
I, [2023-07-30T01:12:22.330791 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":38,"highest_fitness":39304,"elapsed_time":0.24,"last_fitness_increase":34}
|
97
|
+
Highest fitness: 42875 (cce quicfzfriwnlfov jcmpeg over tde razy dhiterdon)
|
98
|
+
I, [2023-07-30T01:12:22.331984 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":38,"highest_fitness":42875,"elapsed_time":0.24,"last_fitness_increase":38}
|
99
|
+
I, [2023-07-30T01:12:22.337603 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":39,"highest_fitness":42875,"elapsed_time":0.25,"last_fitness_increase":38}
|
100
|
+
Highest fitness: 46656 (cce quicfzfriwn iov jcmped over tde razy dhiterdon)
|
101
|
+
I, [2023-07-30T01:12:22.339299 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":39,"highest_fitness":46656,"elapsed_time":0.25,"last_fitness_increase":39}
|
102
|
+
I, [2023-07-30T01:12:22.345225 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":40,"highest_fitness":46656,"elapsed_time":0.25,"last_fitness_increase":39}
|
103
|
+
Highest fitness: 50653 (cce quicfzfrownlfov jcmped over tde razy dhiterdon)
|
104
|
+
I, [2023-07-30T01:12:22.347227 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":40,"highest_fitness":50653,"elapsed_time":0.26,"last_fitness_increase":40}
|
105
|
+
I, [2023-07-30T01:12:22.351709 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":41,"highest_fitness":50653,"elapsed_time":0.26,"last_fitness_increase":40}
|
106
|
+
Highest fitness: 54872 (cce quicfzfrown fov jcmped over tde razy dhiterdon)
|
107
|
+
I, [2023-07-30T01:12:22.357218 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":41,"highest_fitness":54872,"elapsed_time":0.27,"last_fitness_increase":41}
|
108
|
+
I, [2023-07-30T01:12:22.358440 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":42,"highest_fitness":54872,"elapsed_time":0.27,"last_fitness_increase":41}
|
109
|
+
I, [2023-07-30T01:12:22.364078 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":43,"highest_fitness":54872,"elapsed_time":0.27,"last_fitness_increase":41}
|
110
|
+
I, [2023-07-30T01:12:22.369654 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":44,"highest_fitness":54872,"elapsed_time":0.28,"last_fitness_increase":41}
|
111
|
+
Highest fitness: 59319 (cce quicfzfrown fov jcmped over tde razy whiterdon)
|
112
|
+
I, [2023-07-30T01:12:22.375405 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":44,"highest_fitness":59319,"elapsed_time":0.28,"last_fitness_increase":44}
|
113
|
+
I, [2023-07-30T01:12:22.375703 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":45,"highest_fitness":59319,"elapsed_time":0.28,"last_fitness_increase":44}
|
114
|
+
I, [2023-07-30T01:12:22.381433 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":46,"highest_fitness":59319,"elapsed_time":0.29,"last_fitness_increase":44}
|
115
|
+
Highest fitness: 64000 (cce quicf frown fov jcmped over tde razy whiterdox)
|
116
|
+
I, [2023-07-30T01:12:22.383302 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":46,"highest_fitness":64000,"elapsed_time":0.29,"last_fitness_increase":46}
|
117
|
+
I, [2023-07-30T01:12:22.387588 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":47,"highest_fitness":64000,"elapsed_time":0.3,"last_fitness_increase":46}
|
118
|
+
I, [2023-07-30T01:12:22.393407 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":48,"highest_fitness":64000,"elapsed_time":0.3,"last_fitness_increase":46}
|
119
|
+
Highest fitness: 68921 (cce quicf frown fov jcmped over the razy whiterdox)
|
120
|
+
I, [2023-07-30T01:12:22.398133 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":48,"highest_fitness":68921,"elapsed_time":0.31,"last_fitness_increase":48}
|
121
|
+
I, [2023-07-30T01:12:22.400243 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":49,"highest_fitness":68921,"elapsed_time":0.31,"last_fitness_increase":48}
|
122
|
+
I, [2023-07-30T01:12:22.406321 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":50,"highest_fitness":68921,"elapsed_time":0.31,"last_fitness_increase":48}
|
123
|
+
I, [2023-07-30T01:12:22.412106 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":51,"highest_fitness":68921,"elapsed_time":0.32,"last_fitness_increase":48}
|
124
|
+
I, [2023-07-30T01:12:22.418482 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":52,"highest_fitness":68921,"elapsed_time":0.33,"last_fitness_increase":48}
|
125
|
+
I, [2023-07-30T01:12:22.424183 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":53,"highest_fitness":68921,"elapsed_time":0.33,"last_fitness_increase":48}
|
126
|
+
Highest fitness: 74088 (cce quicf frown fov jcmped over the lazy whiterdon)
|
127
|
+
I, [2023-07-30T01:12:22.424324 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":53,"highest_fitness":74088,"elapsed_time":0.33,"last_fitness_increase":53}
|
128
|
+
I, [2023-07-30T01:12:22.431837 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":54,"highest_fitness":74088,"elapsed_time":0.34,"last_fitness_increase":53}
|
129
|
+
I, [2023-07-30T01:12:22.437799 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":55,"highest_fitness":74088,"elapsed_time":0.35,"last_fitness_increase":53}
|
130
|
+
I, [2023-07-30T01:12:22.451459 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":56,"highest_fitness":74088,"elapsed_time":0.36,"last_fitness_increase":53}
|
131
|
+
I, [2023-07-30T01:12:22.457868 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":57,"highest_fitness":74088,"elapsed_time":0.37,"last_fitness_increase":53}
|
132
|
+
Highest fitness: 79507 (cce quicf frown fox jcmped over the lazy whiterdon)
|
133
|
+
I, [2023-07-30T01:12:22.460686 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":57,"highest_fitness":79507,"elapsed_time":0.37,"last_fitness_increase":57}
|
134
|
+
I, [2023-07-30T01:12:22.464659 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":58,"highest_fitness":79507,"elapsed_time":0.37,"last_fitness_increase":57}
|
135
|
+
I, [2023-07-30T01:12:22.470340 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":59,"highest_fitness":79507,"elapsed_time":0.38,"last_fitness_increase":57}
|
136
|
+
I, [2023-07-30T01:12:22.476021 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":60,"highest_fitness":79507,"elapsed_time":0.38,"last_fitness_increase":57}
|
137
|
+
Highest fitness: 85184 (tce quicf frown fox jcmped over the lazy whiterdon)
|
138
|
+
I, [2023-07-30T01:12:22.477398 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":60,"highest_fitness":85184,"elapsed_time":0.39,"last_fitness_increase":60}
|
139
|
+
I, [2023-07-30T01:12:22.482212 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":61,"highest_fitness":85184,"elapsed_time":0.39,"last_fitness_increase":60}
|
140
|
+
I, [2023-07-30T01:12:22.487799 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":62,"highest_fitness":85184,"elapsed_time":0.4,"last_fitness_increase":60}
|
141
|
+
Highest fitness: 91125 (the quics frown fox jcmped over the lazy whiterdon)
|
142
|
+
I, [2023-07-30T01:12:22.490529 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":62,"highest_fitness":91125,"elapsed_time":0.4,"last_fitness_increase":62}
|
143
|
+
I, [2023-07-30T01:12:22.494072 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":63,"highest_fitness":91125,"elapsed_time":0.4,"last_fitness_increase":62}
|
144
|
+
I, [2023-07-30T01:12:22.499682 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":64,"highest_fitness":91125,"elapsed_time":0.41,"last_fitness_increase":62}
|
145
|
+
I, [2023-07-30T01:12:22.505856 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":65,"highest_fitness":91125,"elapsed_time":0.41,"last_fitness_increase":62}
|
146
|
+
I, [2023-07-30T01:12:22.511489 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":66,"highest_fitness":91125,"elapsed_time":0.42,"last_fitness_increase":62}
|
147
|
+
I, [2023-07-30T01:12:22.517122 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":67,"highest_fitness":91125,"elapsed_time":0.43,"last_fitness_increase":62}
|
148
|
+
I, [2023-07-30T01:12:22.523410 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":68,"highest_fitness":91125,"elapsed_time":0.43,"last_fitness_increase":62}
|
149
|
+
Highest fitness: 97336 (the quics brown fox jcmped over the lazy whiterdon)
|
150
|
+
I, [2023-07-30T01:12:22.526540 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":68,"highest_fitness":97336,"elapsed_time":0.44,"last_fitness_increase":68}
|
151
|
+
I, [2023-07-30T01:12:22.529191 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":69,"highest_fitness":97336,"elapsed_time":0.44,"last_fitness_increase":68}
|
152
|
+
I, [2023-07-30T01:12:22.544400 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":70,"highest_fitness":97336,"elapsed_time":0.45,"last_fitness_increase":68}
|
153
|
+
I, [2023-07-30T01:12:22.549967 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":71,"highest_fitness":97336,"elapsed_time":0.46,"last_fitness_increase":68}
|
154
|
+
I, [2023-07-30T01:12:22.556576 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":72,"highest_fitness":97336,"elapsed_time":0.47,"last_fitness_increase":68}
|
155
|
+
I, [2023-07-30T01:12:22.562709 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":73,"highest_fitness":97336,"elapsed_time":0.47,"last_fitness_increase":68}
|
156
|
+
I, [2023-07-30T01:12:22.567740 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":74,"highest_fitness":97336,"elapsed_time":0.48,"last_fitness_increase":68}
|
157
|
+
I, [2023-07-30T01:12:22.573774 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":75,"highest_fitness":97336,"elapsed_time":0.48,"last_fitness_increase":68}
|
158
|
+
I, [2023-07-30T01:12:22.579280 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":76,"highest_fitness":97336,"elapsed_time":0.49,"last_fitness_increase":68}
|
159
|
+
I, [2023-07-30T01:12:22.585746 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":77,"highest_fitness":97336,"elapsed_time":0.49,"last_fitness_increase":68}
|
160
|
+
I, [2023-07-30T01:12:22.592322 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":78,"highest_fitness":97336,"elapsed_time":0.5,"last_fitness_increase":68}
|
161
|
+
I, [2023-07-30T01:12:22.598061 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":79,"highest_fitness":97336,"elapsed_time":0.51,"last_fitness_increase":68}
|
162
|
+
I, [2023-07-30T01:12:22.606232 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":80,"highest_fitness":97336,"elapsed_time":0.51,"last_fitness_increase":68}
|
163
|
+
I, [2023-07-30T01:12:22.614236 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":81,"highest_fitness":97336,"elapsed_time":0.52,"last_fitness_increase":68}
|
164
|
+
I, [2023-07-30T01:12:22.621633 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":82,"highest_fitness":97336,"elapsed_time":0.53,"last_fitness_increase":68}
|
165
|
+
I, [2023-07-30T01:12:22.627619 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":83,"highest_fitness":97336,"elapsed_time":0.54,"last_fitness_increase":68}
|
166
|
+
Highest fitness: 103823 (the quics brown fox jcmped over the lazy white don)
|
167
|
+
I, [2023-07-30T01:12:22.628833 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":83,"highest_fitness":103823,"elapsed_time":0.54,"last_fitness_increase":83}
|
168
|
+
I, [2023-07-30T01:12:22.634844 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":84,"highest_fitness":103823,"elapsed_time":0.54,"last_fitness_increase":83}
|
169
|
+
I, [2023-07-30T01:12:22.641883 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":85,"highest_fitness":103823,"elapsed_time":0.55,"last_fitness_increase":83}
|
170
|
+
Highest fitness: 110592 (the quics brown fox jumped over the lazy white don)
|
171
|
+
I, [2023-07-30T01:12:22.642140 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":85,"highest_fitness":110592,"elapsed_time":0.55,"last_fitness_increase":85}
|
172
|
+
I, [2023-07-30T01:12:22.648572 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":86,"highest_fitness":110592,"elapsed_time":0.56,"last_fitness_increase":85}
|
173
|
+
I, [2023-07-30T01:12:22.653734 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":87,"highest_fitness":110592,"elapsed_time":0.56,"last_fitness_increase":85}
|
174
|
+
I, [2023-07-30T01:12:22.660371 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":88,"highest_fitness":110592,"elapsed_time":0.57,"last_fitness_increase":85}
|
175
|
+
I, [2023-07-30T01:12:22.667228 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":89,"highest_fitness":110592,"elapsed_time":0.58,"last_fitness_increase":85}
|
176
|
+
I, [2023-07-30T01:12:22.674291 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":90,"highest_fitness":110592,"elapsed_time":0.58,"last_fitness_increase":85}
|
177
|
+
I, [2023-07-30T01:12:22.681756 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":91,"highest_fitness":110592,"elapsed_time":0.59,"last_fitness_increase":85}
|
178
|
+
I, [2023-07-30T01:12:22.688350 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":92,"highest_fitness":110592,"elapsed_time":0.6,"last_fitness_increase":85}
|
179
|
+
I, [2023-07-30T01:12:22.694950 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":93,"highest_fitness":110592,"elapsed_time":0.6,"last_fitness_increase":85}
|
180
|
+
I, [2023-07-30T01:12:22.700322 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":94,"highest_fitness":110592,"elapsed_time":0.61,"last_fitness_increase":85}
|
181
|
+
I, [2023-07-30T01:12:22.706848 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":95,"highest_fitness":110592,"elapsed_time":0.62,"last_fitness_increase":85}
|
182
|
+
I, [2023-07-30T01:12:22.713417 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":96,"highest_fitness":110592,"elapsed_time":0.62,"last_fitness_increase":85}
|
183
|
+
I, [2023-07-30T01:12:22.720014 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":97,"highest_fitness":110592,"elapsed_time":0.63,"last_fitness_increase":85}
|
184
|
+
Highest fitness: 117649 (the quick brown fox jumped over the lazy white don)
|
185
|
+
I, [2023-07-30T01:12:22.725963 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":97,"highest_fitness":117649,"elapsed_time":0.63,"last_fitness_increase":97}
|
186
|
+
I, [2023-07-30T01:12:22.728075 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":98,"highest_fitness":117649,"elapsed_time":0.64,"last_fitness_increase":97}
|
187
|
+
I, [2023-07-30T01:12:22.734708 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":99,"highest_fitness":117649,"elapsed_time":0.64,"last_fitness_increase":97}
|
188
|
+
I, [2023-07-30T01:12:22.741613 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":100,"highest_fitness":117649,"elapsed_time":0.65,"last_fitness_increase":97}
|
189
|
+
I, [2023-07-30T01:12:22.748338 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":101,"highest_fitness":117649,"elapsed_time":0.66,"last_fitness_increase":97}
|
190
|
+
I, [2023-07-30T01:12:22.769795 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":102,"highest_fitness":117649,"elapsed_time":0.68,"last_fitness_increase":97}
|
191
|
+
I, [2023-07-30T01:12:22.776134 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":103,"highest_fitness":117649,"elapsed_time":0.68,"last_fitness_increase":97}
|
192
|
+
I, [2023-07-30T01:12:22.784354 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":104,"highest_fitness":117649,"elapsed_time":0.69,"last_fitness_increase":97}
|
193
|
+
Highest fitness: 125000 (the quick brown fox jumped over the lazy white dog)
|
194
|
+
I, [2023-07-30T01:12:22.786897 #3193] INFO -- : {"id":"57370bc2-76bb-44a4-855d-318f3439e972","generation_count":104,"highest_fitness":125000,"elapsed_time":0.7,"last_fitness_increase":104}
|