Sixty frames = one simulated year.
Changed the mechanics a bit. Added more color information.
Green - too young
Grey - too old
Pink - female
Blue - male
Solid Pink - take a guess
Things that affect the outcome.
Population density - the larger the starting population the more likely the simulation will sustain
Size of the circles - the larger they are the more plentiful will be the collisions
CONST min - The lower the more fruitful the society will be
CONST maxm - The higher "
CONST maxf - The higher "
The goal is to achieve simulation sustainability without too explosive growth and with not too many failures.
DISCLAIMER ABOUT THE CURRENT SETTINGS
It is just a numbers game. The settings are restricted to what is commonly possible. They are not 100% realistic. It is not meant to be politically correct. So just consider these settings being for a primitive society without written laws or moral standards.
The morally correct may want to increase the circle size and increase the minimum age! Etc.
Initialize
repeat = 1
object(i).sex = 0
IF object
(i
).sex
= 1 AND object
(i
).age
> min
AND object
(i
).age
< maxm
THEN object(j).sex = 0
IF object
(j
).sex
= 2 AND object
(j
).age
> min
AND object
(j
).age
< maxf
AND object
(j
).dt
= 0 THEN d
= SQR((ABS(object
(i
).x
- object
(j
).x
) ^ 2) + (ABS(object
(i
).y
- object
(j
).y
) ^ 2)) IF d
< 13 THEN object
(j
).dt
= 46 object(j).dt = 0
count = 0
object
(k
).sex
= RND * 2 + 1 object(k).age = 0
object
(k
).x
= RND * (sw
- 24) + 12 object
(k
).y
= RND * (sh
- 24) + 12 object(k).dt = 0
object(i).age = object(i).age + 1
IF object
(i
).sex
= 2 AND object
(i
).dt
> 1 THEN object
(i
).dt
= object
(i
).dt
- 1 c = 2
IF object
(i
).age
> min
THEN c
= 11 IF object
(i
).age
> maxf
THEN c
= 7 IF object
(i
).age
> min
THEN c
= 13 IF object
(i
).age
> maxf
THEN c
= 7 object
(i
).vx
= object
(i
).vx
+ RND * .1 - .05 object
(i
).vy
= object
(i
).vy
+ RND * .1 - .05 object(i).x = object(i).x + object(i).vx
object(i).y = object(i).y + object(i).vy
IF object
(i
).x
< 13 THEN object
(i
).vx
= 1 IF object
(i
).x
> sw
- 13 THEN object
(i
).vx
= -1 IF object
(i
).y
< 13 THEN object
(i
).vy
= 1 IF object
(i
).y
> sh
- 13 THEN object
(i
).vy
= -1 CIRCLE (object
(i
).x
, object
(i
).y
), 12, c
IF object
(i
).sex
= 2 AND object
(i
).dt
> 0 THEN PAINT (object
(i
).x
, object
(i
).y
), c
object(i).sex = 0
object(i).sex = 1
object
(i
).age
= RND * 6000 object
(i
).x
= RND * (sw
- 24) + 12 object
(i
).y
= RND * (sh
- 24) + 12
object(j).sex = 2
object
(j
).age
= RND * 6000 object
(j
).x
= RND * (sw
- 24) + 12 object
(j
).y
= RND * (sh
- 24) + 12