Closed dvberkel closed 8 years ago
I have been musing on the various genetic operations on the moon lander program structure.
Specifically I want to raise the following concerns
Should the operations mutate the program structure or should a copy be made.
Should mutation mutate recursively? The idea behind mutation is to allow programs to escape local optima by having a small chance of changing. The problem is that with larger programs, even with a small probability of mutation for each kind of structure, we could end up mutation a lot.
I have the feeling that crossovers should be commutative. I.e. For two programs p
and q
I feel that crossover(p,q)
and crossover(q,p
should be the same, in the sense that they should produce programs according to the same distribution.
The reason I am raising this concern is that with the implementation of crossover I have in mind, i.e. pick a random node of p
and try to crossover with a similar random node in q
, seems depend on the program you start with.
The simplest solution that springs to mind, if it is a problem at all, is to crossover twice to allow both crossover(p,q)
and crossover(q,p)
.
I've gotten most of my knowledge from this page, which provides a good overview yet is very accessible (imho):
http://geneticprogramming.us/Genetic_Operations.html
My take on this:
Arc<>
a whole lot which would be bad for performance. For maximum performance, we might want to go arena allocating the structures.I will take a look at the link you provided.
I suppose actually the arity doesn't matter. I feel like if we swap any 2 subtrees we should be good.
Actually the program should be grammatically correct. So you can not just swap any two subtrees. See structure
Ah, of course!
Well, we can make a list of node types that occur in both trees and draw randomly from that list. They must share at least one--even if it's only the root, which will always be the same type.
Genetic algorithms are implemented in the darwin
module
Genetic programming
should be able to safely bring a lander to the surface of the moon. Create the various kinds of genetic operations on abstract syntax trees.