Content deleted Content added
Line 131:
== Example: Digital arts ==
[[File:Initial_random_fly_population.png|129x130px|thumb|right|Image of the initial population (random fly positions).]]
[[File:Mosaics_flies_flowers.png|129x130px|thumb|right|Image reconstructed after optimisation using a flower as a shape for each tile.]]
In this example, an input image is to be approximated by a set of tiles (as in an ancient [[mosaic]]). A tile has an orientation (angle θ), a three colour components (R, G, B), a size (w, h) and a position (x, y, z). If there are ''N'' tiles, there are 9''N'' unknown floating point numbers to guess. In other words for 5,000 tiles, there are 45,000 numbers to find. Using a classical evolutionary algorithm where the answer of the optimisation problem is the best individual, the genome of an individual would made of 45,000 genes. This approach would be extremely costly in term of complexity and computing time. The same applies for any classical optimisation algorithm. Using the Fly algorithm, every individual mimics a title and can be individually evaluated using its local fitness to assess its contribution to the population's performance (the global fitness). Here an individual has 9 genes instead of 9''N'', and there are ''N'' individuals. It can be solved as a reconstruction problem as follows:
Line 136 ⟶ 138:
where <math>input</math> is the input image, <math>x</math> and <math>y</math> are the pixel coordinates along the horizontal and vertical axis respectively, <math>W</math> and <math>H</math> are the image width and height in number of pixels respectively, <math>F</math> is the fly population, and <math>P</math> is a projection operator that creates an image from flies. This projection operator <math>P</math> can take many forms. In her work, Z. Ali Aboodd <ref name=Abbood2017EvoIASP /> uses [[OpenGL]] to generate different effects (e.g. mosaics, or spray paint). For speeding up the evaluation of the fitness functions, [[OpenCL]] is used too.
The algorithm starts with a population <math>F</math> that is randomly generated (see Line 3 in the algorithm above).
== See also ==
|