[IAEP] 7th-grade biology

Bert Freudenberg bert at freudenbergs.de
Wed Jul 1 04:41:17 EDT 2009


On 01.07.2009, at 10:14, forster at ozonline.com.au wrote:

>> I and others are starting a project in 7th-grade biology teaching and
>> learning, with a focus on pre-biotic and biological evolution, ...
>> Anybody interested?
>
> Edward, see smartbug at http://rupert.id.au/schoolgamemaker/samples3/
>
> Bugs start out with a matrix of random numbers which relate their  
> sensor input to motion output through a neural net. This represents  
> their genes. Random mutations in the genetic code happen each cell  
> division. They soon evolve optimum feeding patterns,
>
> Programmed in Game Maker but should be doable in Etoys or Scratch

Sounds intriguing. Too bad I can't try it on my machine, but at least  
I could extract the description from the gamemaker file which looks to  
be detailed enough to recreate the simulation:

Smartbug
Tony Forster October 05
Evolution through natural selection
May be copied with acknowledgement

mouse click 	select, displays bug info including genetic code
p 		pause
c 		de-select all
a		select all
d		display detail: all, population&health, none
f		save population stats to comma separated file
F1 		to display this screen
escape 	return to simulation

The info boxes show the "genetic code" or the program the bugs have  
developed by natural selection. You can see how the bugs are related.  
(The level of information you display affects the program speed.)

The save to file option allows you to import population statistics  
into a spread sheet and examine population trends

How its programmed
Each bug loses one unit of health per step
set variable bughealth relative to -1

If a bug runs out of food it dies
set variable bughealth relative to -1
if bughealth is smaller than 0
       destroy the instance

If it eats food, its health increases
set variable bughealth relative to 150

If its health reaches 1000 it divides
if bughealth is larger than 1000
       execute code:
       bughealth=500
       newid=instance_create(x+20,y+20,bug)

Its genes are copied to the new bug
for (i=0 ;i<20; i+=1)
{
     for (j=0;j<12; j+=1)
     {
         newid.gene[i,j]= gene[i,j]
     }
}

One gene is mutated
newid.gene[random(20),random(12)]=random(100)-50

The genes are used to determine behaviour
There are 20 inputs, 8 related to food nearby, 4 previous direction  
and 8 memory stores
execute code:
input[0]= sign(instance_position(x+15,y,food))
input[1]= sign(instance_position(x-15,y,food))
input[2]= sign(instance_position(x,y+15,food))
input[3]= sign(instance_position(x,y-15,food))
input[4]= sign(instance_position(x+22,y,food))
input[5]= sign(instance_position(x-22,y,food))
input[6]= sign(instance_position(x,y+22,food))
input[7]= sign(instance_position(x,y-22,food))

for (i=8; i<20; i+=1)
{
     input[i] = sign(output[i-8])
}


The 20 inputs are multiplied by a 20x12 gene array to produce 12 outputs
for (i=0 ;i<20; i+=1)
{
     for (j=0;j<12; j+=1)
     {
         newid.gene[i,j]= gene[i,j]
     }
}

Four of which control motion
if (output[0]>0)hspeed=-1
if (output[1]>0)hspeed=1
if (output[2]>0)vspeed=-1
if (output[3]>0)vspeed=1

and eight are memory data

Discussion
See how badly adapted lifeforms become extinct:
The first to die are the ones that don't move
Soon they are all related through one ancestor
Diagonal movers take over from horizontal and vertical movers
They learn to spread out
Some get stuck with some food patterns and die
Run it overnight, eventually the learn to hunt for food.
Run it on 2 computers, compare the genetic code.

Enable save to file "smartbug.txt" with the f key
Import the comma separated text file into a spreadsheet
Graph it
What is the average bug population? Why?
What is the trend in food population? Why?
Why are there fluctuations?

Is it sexual or asexual reproduction?
What are the implications for the gene pool and the evolutionary  
process?
Is this a good model of evolution?

Programming challenge
Write a version with sexual reproduction, when two bugs with  
health>1000 collide, they produce offspring with genetic code taken  
randomly from its parents.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/iaep/attachments/20090701/9c84699b/attachment-0001.htm 


More information about the IAEP mailing list