HTML5 Genetic Cars
rednuht.org
rednuht.org
In my instance, there are two predominant "types" of cars that are doing approximately equally well--the "rhinoboat" and the "assdragger". But when these two solutions are combined in the crossover, I think they make an offspring that is terrible.
If the algorithm would mate only the rhinoboats with rhinoboats and assdraggers with assdraggers, I'm convinced we'd end up with some superrhinoboats and superassdraggers, but instead I just get an unhappy compromise.
Maybe make "similarity to self" one of the genotype parameters. A high rating here would mean the phenotype would have a bias against being combined with dissimilar creatures. This allows the propensity towards speciation to develop evolutionarily, too.
But my current instace of the web page is at a point where it's wasting a lot of time on unfit 'mutts' and it seems like I could get to a "best rhinoboat" and "best assdragger" solution faster if it would stop wasting time exploring the mediocre blend.
I didn't dig into this implementation, but it seems like it doesn't carry many (more than one?) individuals between cycles.
Successful parameters could also become more immune to mutation with time, a nice improvement along with "speciation" you cited.
Haha, I've had this same thought before. I wrote a genetic algorithm to work on the sphere packing problem (in a periodic box) and I kept thinking about how I could mutate the settings within the program and optimize them, and then mutate the rate at which those settings themselves changed, and so on. I wonder if there's an optimal point to stop being "meta"?
I say this because this reminded me of a wonderful (and acessible) discussion I once glanced over on the following book: http://www.cs.toronto.edu/~mackay/itprnn/book.pdf (Page 269, pdf 281) -- it offers answers to this sort of question :)
So called, because unfortunately GAs etc. had already taken the name "meta-heuristics".
Perhaps this will help your thinking in the right direction: http://en.wikipedia.org/wiki/No_free_lunch_in_search_and_opt...
I believe this happens in nature. DNA has lots of error correcting stuff to reduce errors.
When the hybridization is managed by humans though, it can be useful (e.g.: citrus, mules).
There is really no advantage in speciation if you only want the single best solution, but it does make sense to try different evolutionary paths as they can end up in totally different places.
If speciation is a better heuristic for finding a better solution faster than the algorithm used here then its advantage is real and useful in any case.
If you divide the population in two, at least half of your resources are wasted on doing tests and evolving traits which will just be discarded. Resources which could have been used to speed up the evolution of the other population. Even if the evolutionary path you choose isn't the optimal one, by putting twice as much resources too it, it still might end up further. And if you divide it into more than 2 species than it's just getting insane.
That's not to say that speciation isn't a useful heuristic, just that it's a costly one. However there are a lot of cases where just throwing more resources at the problem doesn't help, because it's stuck in a local maxima. In that case, going back to an earlier point in the simulation and running it to see if it ends up somewhere else isn't a bad idea, and that's exactly the same as what speciation is (except that you are doing it after the fact, rather than testing both evolutionary paths simultaneously.)
It's not fancy hmtml, but it's the best genetic simulation I've seen. The "swimmers" exist in 2d space, seek out food and mate. Only the best will reach the food fast enough, and there are colors which a given swimmer will prefer to mate with, and space separating different populations. It's very possible to get several distinct populations which behave in entirely different ways.
I suspect - would be interested in anyone who's worked it out - that each individual is mutated between each generation.
I tried 10 Elites with high rate of mutation. I'd have expected this to have more "breeding" from the Elites, but it doesn't. It tends to plateau. Occasionally an outlier jumps into the "10", but it's pretty flat.
So.. Is there any concept of "fitness"? If so, it ends up being pretty random, since there is no penalty for a less adaptive mutation.
It's a trade-off between exploration and exploitation. If you speciate then you have little sub-populations exploiting the local maxima, so they might do better. However, now you're not searching such a wide area so you're more likely to spend your time struggling to the top of the molehill that's next to the mountain.
In nature this also happens. Not having crossovers between ludicrously different things is generally a good idea because the landscape is full of tiny maxima. If you change a load of base pairs in your DNA you're less likely to be able to do things like form cells or process glucose than you are to add some awesome new power (unless we're in comic books).
One of the major differences for nature is that it can run all this jazz in parallel. If there are resources, it can happily have 10 trillion bacteria rather than 5 without any cost. When we're simulating, every fitness measurement on a piss-poor crossover is a waste that we should have spent on a more likely solution.
It all depends on the fitness landscape, but both approaches can be better on different real world problems.
A typical work-around for scenarios like this would be to have the various parameters change as the simulation carries on; e.g. later on it might make more sense to increase the number of elites as a way of limiting crossover.
As an aside, if this were a dream the inference would still work, but the conclusion would be false (as the poster obviously has no existence independent of the dreamer). But, unfortunately, you will be able to provide no conclusive evidences that this world is not as illusory as the dream world is, as your only sources of evidence are your senses, which are also apparently available to you in the dream state (which you are not able to perceive as illusory whilst dreaming).
Reality? lol.
http://www.youtube.com/watch?v=l-qOBi2tAnI http://www.youtube.com/watch?v=AUXc6mckGLE
That program was really awesome, the things could even have sensors that made muscles move on ground contact; and I so hoped for "underwater movement" to be implemented fully, but it never came to that :(
We now have WebGL, we have local storage... Anyone? I think it's beyond my ken, but for those who know this stuff, the question basically is if you have free time and want to be a superhero. If 2D cars on a canvas can be this fun, imagine sharing 3D virtual creatures with just a link, or even better, having them cooperate or fight each other ^^
It would also be nice if the designs could be more complex, and not just a random star-shaped polygon + two wheels.
If you try to crack a password with a wordlist, would you do it randomly, or would you order by word frequency? The later is smarter, but it's still brute forcing (resource/time intensive).
I have a layout that is defeating all cars even after 50 generations and counting. Would love to keep on testing against this world.
I got to around 200 without hacking after about 300 generations but then the terrain just gets too much for any of the little guys.
So if you want to beef them up a little, type this in javascript console:
motorSpeed = 50;
wheelMaxRadius = 2.0;
chassisMaxAxis = 2.5;
and hit New PopulationSo great ahahahaha
"The program uses a simple genetic algorithm to evolve random two-wheeled shapes into cars over generations. Loosely based on BoxCar2D, but written from scratch, only using the same physics engine (box2d). seedrandom.js written by David Bau. (thanks!)"
Edit: 71044092 beats that (declines 47 units in the distance of the track, which is 220 units long).
There really is something to this that needs exploration as a multiplayer game. The aleatoric quality makes it infinitely watchable for me. GenetExcitebike.
This quality?
The "aleatoric" part was a separate observation about a quality of the simulation that made it more enjoyable for me. And then upon further reflection, it seemed to me that this simulation had (or could have) all the elements of a game, as classified by Caillois.
This one has some amazing features. Hopefully Rafael will give us some way to compete!
Sadly, that is pretty much the only bit I understood, ish...
Level: marc - 172.68
It was a very tough track...
At the 190 mark the world goes all glitchy and half the track disappears.
It's a shame it's not as deterministic as it could be (according to the blurb at the bottom of the page), since this [probably] means the genetic algorithm can't exploit quirks and things being "just right" optimally. Rather, it has to build something that is a bit more generalised.
The car made it thru the whole level and just kept falling forever. I think it was a very lucky fluke.
screenshot https://www.dropbox.com/s/8777mtx2g6maf96/Screen%20Shot%2020...
Believe it or not, my cars evolved into "Flying Cars" (They start with one wheel stuck in the terrain, moving slowly forward, then it releases and goes flying over the track)
Definitely weird and interesting. The funny thing to me was that it is sort of a "realistic" evolution, since flying cars could be an eventual next step for real-life transportation. Although hopefully with a less violent launch system :)
I feel like it's only a matter of time before some startup implements a genetic driven visualization of the data from their app. If the effect is as compelling, I'd be staring at their marketing page for a long time.
Just like the shapes of the chassis and the size of the wheels in this demo are essentially numeric data visualized into a series of canvases, some hypothetical startup's data could be visualized in a potentially compelling manner. That's presuming, ofc, that the original data is already suitable for genetic manipulation.
What that data/startup would be? I don't know, just casting an idea.
Edit: This app is very well put together. The "winner"(one that got the furthest) of the previous round is up front for the next and I believes becomes the zero car
Last parameter is the angle
How does this work exactly?
EDIT: It seems the one that almost made it was a replay ghost or something and not part of the population. Still wondering if I understood it correct though.
This tries to simulate simple "swimmers" where the fastest survives and spawn new entities with slight variations.
(Note: this is not my best code :-))
At the moment, if you add "elite clones", the camera follows the stack (but all are exactly on top of each other) and it's a bit slow.
That seems his past time, when not coding genetic algorithms...
There is an epic hill at 180..... Will give it another 10 generations and see what they can do.
#1: 200.72 d:195.95 h:-5.38/6.55m (gen 669)
Edit: 175 has been cleared by one of my populations at generation 155! 187 is definitely impassable, though. http://imgur.com/GwO4j4W
#1: 192.22 d:187.68 h:-0.61/17.32m (gen 4694)
#2: 192.09 d:187.42 h:-0.75/17.78m (gen 7914)
#3: 191.32 d:187.34 h:-0.75/18.05m (gen 7430)
#4: 191.16 d:186.26 h:-0.75/16.91m (gen 7822)There didn't appear to be anyway to send a small donation to the creators.
People competing against each other on a variety of pre-made tracks would be amazing.
at 200, there's a bloody wall!!!