Test it here -> https://7verr.csb.app/
In this web application, you can draw shape using defined rules.
With "AI" button, you can draw random shape with genetic algorithm.
- Initial population - generate random shapes using defined rules
- Natural selection - rate shapes from initial population and remove 1/4 with worst marks
- Crossover - divide shapes into pairs and add parts of them to each other
- Mutation - shapes after crossover are mutated with random intensity. Mutation changes some parts of shape
- New generation - after mutation new generation of shapes is created. They are rated and the best of them is displayed to user. Now this is our initial population.
-
Application allows to make shapes using defined 5 rules. However we can not use them randomly (e.g. we can not use rule that make a line in different direction just after square, we have to change square to line first)
-
After generating random shape, we can continue drawing with other buttons
-
Shape is represented as a list of rules (we have 5 defined rules)
-
If generated shape(in genetic algorithm) leaves canvas borders, shape is cut from rule that left the border, so mutation or crossover can significantly shorten the shape
-
To fasten visual changes, every click on "AI" button passes 5 generations
-
In genetic algorithm shape is rated: +1 for line, +3 for square and +5 for turn
