« Blog時代の用語集(JP) | Main | Spry Review Part3(JP) »

Genetic Algorythm Part1

I will introduce the implementation of Genetic Algorythm with ActionScript 2.0. This sample shows a world that multiple bugs walk around in the stage, and it will be based on how its own bugs work on one another's behaviors under any conditions. It only have two classes; the World class and the Bug class. The World class is used to store a string of a linkage id of the bug and a reference to a movieclip for attaching movieclips dynamically, and to create bugs into the target. The bug class have two numbers; a speed and a bearing as a vector to move around using onEnterFrame event.

source code

import ai.*;
var world = new World(this);
world.initialize(Bug.LINKAGE_ID, 6);

Post a comment