3 ms·
In my artificial neural networks class, we had a guy who attempted to do just this... in bash... to generate C code... using temp files to pass data around.
by Groxx 16y ago
In my artificial neural networks class, we had a guy who attempted to do just this...
in bash...
to generate C code...
using temp files to pass data around.
They didn't get far, but did actually manage to get something to print after a few hours, though it never seemed to get closer to "hello world" after that point. We figured it was just that the GA was a bit overly proud of its accomplishment, and wasn't interested in improvement. This is with random strings inside a main() wrapper with stdio, and nothing else. I forget what their fitness function was, but I'm fairly certain it wasn't too simple, and I think that shot them in the foot near the end.
I still boggle at the attempt; I built a maze solver in Ruby that handled changing mazes by ant-trail-like solving (I forget the term...) that only took me a handful of hours. Then I spent another 10 to make modifying the maze as simple as possible, and I made a dozen or so wildly different mazes with moving walls, transporters, etc while doing my presentation to demonstrate that it worked. I think that may have won me more points than the functioning code; lots of people's barely worked, and nobody else had anything they could run in reasonable times during a presentation.
- StavrosK 16y agoThe term is Ant Colony Optimization: http://en.wikipedia.org/wiki/Ant_colony_optimization http://en.wikipedia.org/wiki/Ant_colony_optimization
- Groxx 16y agoThat's the one, thanks! And ooh, I hadn't thought of setting it up for a traveling salesman problem... that does seem like a good application. Never knew that was one of the first uses; the moment I grasped the principles, maze-solving seemed a logical use.
- StavrosK 16y agoI did try that once, the results were very good, though not optimal. It did converge very quickly to a good solution, however.
- user24 16y ago> This is with random strings inside a main() wrapper with stdio I'm impressed it managed to get something which ran at all! Usually with GP you at least start with a set of valid operations and keywords (eg genes=['function','printf','return','...etc']) and mix those together randomly.