Italian version
Italian version

Genetic algorithms for the GRI

In these days I produced a really beautiful piece of software to optimize the GRI effective area. Genetic algorithms are used to optimize the crystal distribution on a Laue lens, a problem too complex to be solved in other ways. The lexycon used in the following is typical of this well established science.

The underlying idea is the following: the crystal distribution in the lens is like the genome and each lens has its own. Different crystal arrangement produce different effective area and we want the effective area to be as smooth and as high as possible.
Each ring of the lens is threated as a gene that contains four informations:

  • No. of Cu(111) crystals;
  • No. of Cu(200) crystals;
  • No. of Ge(111) crystals;
  • No. of empty spaces.

The complete genome is a sequence of all the genes for the rings in the lens. The effective area is now computed (represents the fenotype) and evaluated through a fitness function that returns how much a lens effective area fits the requests.
When the software runs, first it creates a "village" of lenses with random or user defined dna and at each loop it decides wich elements should survive (of course the most fit to our requirements). The other elements are kindly killed and replaced with:

  • stranger;
  • offspring;
  • mutants;

to keep the population constant.
The three kind of newcomers are most effective, respectively, at the beginning, in the middle and at the end of evolution process.
The strangers are new lenses with random crystal distribution; the offsprings are the the child of two survived lenses, obtained with the crossover of the parents dna (rings are mixed together) and mutants are obtained cloning a survived element and varying only one or few gene. The most convenient choice for a fine tuning is to change only one crystal (or empty space) with another crystal (or empty space).

The best elements of three populations after several loops (generations) are showned here.

The different curves are obtained trying to satisfy the requests:

  1. High area;
  2. High smoothness;
  3. A reasonable compromise;

Of course these are only examples.

The number of generation needed to converge to satysfying results depends on the choices of the user, like the population number and the number of newcomers of each type and on the mutation and crossover function. At the end it becomes a very nice game to play with :)

Site Navigator
Home
Science
    Laue lens
    Genetic Algorythms
    Publications
Software
Free Time
Photo Gallery
Links & Info
 
Links
Blog
Polisposportiva Casaglia
Unife
 
Misc
Credits
Search
Ye olde Darkmoon ;(
 
Contacts
Darkmoon mail
My
status
 
Last update
page: 23 Oct 2007
site: 14 Jan 2008