Team:Newcastle/Modelling/Cell Fusion
From 2013.igem.org
Cell Fusion
Simulation rules and parameters
Movement. Every L-Form has random movement speed which is 1-6 px per game step, furthermore they have movement direction, there are 2 variables which represent their movement per step on x axis and y axis. Every simulation step there is a random number [-2,2] generated which is then added to current speed. Also there are speed limits so that L-Forms cannot move faster than -6px or 6px on any axis.
Division. There is 1/100 chance per step that division algorithm will be triggered, provided there is at least 1 "unused" L-Form entity. If this happens, then 3 biggest(in radius) L-forms are selected, provided they are not already dividing.
L-Forms. Simulation starts with 11 L-Forms(5 red, 6 green), which have random radius of (10-20 pixels) .
Location. All L-Forms are randomly created on the screen.
Collision . When 2 L-Forms collide there is 50% chance that bigger L-form will absorb the smaller one, otherwise they just bounce off. If absorption happens, in that case we calculate smaller L-form's surface area and add it to the bigger L-Form's surface area. The absorbed ball entity is marked as "unused" and moved away from the screen.
Colour . Originally we start with RED and GREEN colours. When collision happens L-Forms will keep the same colour, or if two different colours collide they will become yellow.
itIf you want to see the code or run in, or even edit it in your local java environment, you can find download source code from here.