Question

I found this very cool C++ sample , literally the "Hello World!" of genetic algorithms.

I so decided to re-code the whole thing in C# and this is the result.

Now I am asking myself: is there any practical application along the lines of generating a target string starting from a population of random strings?

EDIT: my buddy on twitter just tweeted that "is useful for transcription type things such as translation. Does not have to be Monkey's". I wish I had a clue.

Was it helpful?

Solution

Is there any practical application along the lines of generating a target string starting from a population of random strings?

Sure. Imagine any scenario in which you know how to evaluate the fitness of a particular string, and in which the choices are discrete and constrained in some way:

  • Picking pronounceable names ("Xhjkxc" has low fitness; "Artekzo" has high fitness)
  • Trying out a series of chess moves
  • Guessing the combination to a safe, assuming you can tell how close you are to unlocking each tumbler
  • Picking phone numbers that evaluate to words (e.g. "843-2378" has high fitness because it spells "THE-BEST")

OTHER TIPS

No. Each time you run the GA, you are giving it the eventual answer. This is great for showing how a GA works and to show how powerful it can be, but it does not have any purpose beyond that.

You could write an EA that writes code in a dynamic language like IronPython with the goal of creating code that a) executes without crashing and b) analyzes the stock market and intelligently buys and sells stock.

That's a very simplistic take on what would be necessary, but it's possible. You would need a host that provides a lot of methods for the IronPython code (technical indicators, etc) and a database of ticks.

It would also be smart to not just generate any old random code, lest you format your own hard-drive. You need a sandbox, and you need to limit the namespaces that are accessable, and you would need to provide a time limit to avoid infinite loops. You could also provide symantic guidelines that allow it to choose appropriate approved keywords instead of just stringing random letters together -- this would greatly speed up evolution.

So, I was involved with a project that did everything but the EA. We had a satellite dish that got real-time stock ticks from the NASDAQ, a service for trading that had an API, and a primitive decision making "brain" that made decisions as the ticks came in.

Sadly, one of the partners flipped out, quit his job, forked the project (got his own dish, etc), and started trading with logic that wasn't ready. He lost a bunch of money. It turns out that for some people this type of project is only a step away from common gambling. But anyway, the project kind of fizzled out after that. Evolving the logic part is the missing link though. And I know there are people out there doing this type of thing.

I have used GA in 2 real life research problems.

One was a power optimization problem (maximize number of appliances turned on, meeting the available power constraint and service guarantee for each appliance)

Another was for radio network optimization, maximizing the coverage area given a fixed equipment budget

GA has one main disadvantage, it usually works with genetic speed so using it in some serious time-dependant projects is quite risky.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top