This is going to be a little different than most other posts I've written.
For the 2015-2016 school year, my Science Fair project involved the program used in the "Interactive Fractal Trees" post, but with one addition: The tree evolves.
The new program uses an evolutionary algorithm, which is a way to optimize just about anything to fit a specific purpose. In the case of my project, it is being used to optimize a tree to capture the most available sunlight.
An evolutionary algorithm begins by randomly generating a population of individuals - in this case, trees. It then evaluates each one with a fitness function, which quantitatively returns how "good" the individual is. The trees' fitness function is the amount of sunlight captured divided by the amount of wood used. It then selects the best one, copies it to form a new population, and adds small, random mutations to the copies. This is equivalent to the passing of a single generation. It then repeats this process until the population has reached a local maximum, where a small mutation will not increase the fitness function. At this point, the evolution effectively stops.
There are two variants of this program, one that involves fractal trees and one that involves non-fractal ones. The download links for the source files are below.
These programs are written in Processing, a Java library and IDE. The library includes functions for graphical rendering. Download Processing here or use an in-browser editor here.
For the 2015-2016 school year, my Science Fair project involved the program used in the "Interactive Fractal Trees" post, but with one addition: The tree evolves.
The new program uses an evolutionary algorithm, which is a way to optimize just about anything to fit a specific purpose. In the case of my project, it is being used to optimize a tree to capture the most available sunlight.
An evolutionary algorithm begins by randomly generating a population of individuals - in this case, trees. It then evaluates each one with a fitness function, which quantitatively returns how "good" the individual is. The trees' fitness function is the amount of sunlight captured divided by the amount of wood used. It then selects the best one, copies it to form a new population, and adds small, random mutations to the copies. This is equivalent to the passing of a single generation. It then repeats this process until the population has reached a local maximum, where a small mutation will not increase the fitness function. At this point, the evolution effectively stops.
There are two variants of this program, one that involves fractal trees and one that involves non-fractal ones. The download links for the source files are below.
These programs are written in Processing, a Java library and IDE. The library includes functions for graphical rendering. Download Processing here or use an in-browser editor here.
fractal_tree.pde | |
File Size: | 3 kb |
File Type: | pde |
non_fractal_tree.pde | |
File Size: | 3 kb |
File Type: | pde |