gmlewis

gmlewis

Genetic Algorithms in Elixir: Some feedback, a question and suggestion

@seanmor5 - This is a great book so far… I’m enjoying reading and coding along with it!

Quick question, though - since “evaluate” goes to the trouble of calling the “fitness_function” and generating an updated list of Chromosomes with the new calculated “fitness” values in the struct, instead of ending the function with this (where it has to call the “fitness_function” a bunch more times):

 |> Enum.sort_by(fitness_function, &>=/2)

why not end it with this (in order to use these pre-calculated values)?

|> Enum.sort_by(& &1.fitness, &>=/2)

Also, I’m kinda sad that you dismissed the tree-type genetic programming like John Koza did in the 60s and 70s (to generate electronic circuits and a whole bunch of other cool stuff), but that is a huge topic in itself. Also, I’m extremely interested in Gene Expression Programming invented by Dr. Candida Ferreira, but that is also tree-type.

Anyway, thanks for the great book, and I look forward to your updates!

– Glenn

Marked As Solved

seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Good catch! I think that’s the result of me forgetting to update the call to sort_by after I added in the fitness calculation for each chromosome. I’ll make sure that gets fixed.

I thought a lot about whether or not to include some examples of Genetic Programing and other tree-type methods. Ultimately I thought it might have been a lot of overhead just to get a simple example up and running and I was trying to cover a lot of ground without getting too carried away with any one topic. I was also trying to make sure the topics built on top of one another and felt like a dive into tree-based encodings and their applications would have been too much of a detour from the progression of the book.

Now that you mention it I think a dive into tree-based encoding schemes would make for an excellent supplement to the book. I’ll put something together and release it on my blog for anybody who’s interested.

Also Liked

seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Thanks for the suggestion. It’s in my profile. Not much content…yet.

gmlewis

gmlewis

Awesome! Can you please provide a link to your blog? I don’t remember seeing it in the book (yet).

Also, just for kicks, you might enjoy checking out my early attempts of Gene Express Programming (in Go) from a few years back: GitHub - gmlewis/gep: Gene Expression Programming in Go

– Glenn

AstonJ

AstonJ

You could add it to your profile as well Sean :+1:

Where Next?

Popular Pragmatic Bookshelf topics Top

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1023 17214 380
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New

Sub Categories: