Result of generation of the first generationI am not a designer. But sometimes you have to invent some design for some of your projects, which I really don't like to do. Conjuring a few hours in Photoshop, nothing interesting comes to mind. It seems to make some kind of layout, but something is missing. Something wrong. Need inspiration. That is how the idea was born to make a visual interface generator that would serve as a source of inspiration, suggest some forms and their position. And then the idea of ​​making a genetic algorithm came to my troubled head, where I would act as a fitness function with my subjective assessment. Looking ahead to say that nothing special came out of this idea.
The idea was this: a “layer” is created, where there is a certain random number of objects with a random position, size, angle radius and rotation. Such layers are created 6 pieces. You, as a
mountain designer,
choose from six generated objects the most interesting and successful from your point of view. Thus, having selected 10 layers, the first generation is formed, from the individuals of which new layers are generated, randomly crossing the layers you like. And so again 10 layers, and again a new generation ...
')
The main problem of the whole idea is that it turned out to be very, very difficult to choose the function of crossing. It is completely unknown what needs to be crossed. I tried 3 different options:
- Take items from different layers "as is" and add to the new
- Take some properties of elements from one and another layer and cross them
- Combine the first and second
But they did not succeed. New individuals turned out to be not much different from randomly generated ones, and after several generations, they nevertheless stood out common properties, but absolutely not the ones I would like to see, not the ones I liked. In addition, using yourself as a fitness function is a very time consuming and long exercise.
Here is an example of what happens on the 10th generation:

The project somewhere half a year lain neither there nor here. And today, stumbling on him decided to post it on
github .
Demo is available here.PS I'm not a javascript guru, and I work with him as needed. This is not the main language. Therefore, please leave comments on the code with you.
UPD: In the group of habr, in the VC flashed the question "Why?"
Answer: This is a test of the idea of ​​a genetic algorithm, where a person acts as a fitness function. And if you solve the problem of crossing, something interesting may turn out. For example, you can make a parser that will build a block structure from existing sites with a real design. Further to use this base as a basis for new generations. Then you can eliminate the initial random and get more interesting individuals that really will be valuable. Now, I see concepts for various promotional sites in these heaps.