Complex organism evolution

Complex organism evolution preview image

1 collaborator

Default-person Al Pugh (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.2 • Viewed 269 times • Downloaded 22 times • Run 0 times
Download the 'Complex organism evolution' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [bugs bug]                                  ; efficiency = energy obtained from eating plants
bugs-own [ energy threshold efficiency ]          ; threshold = energy required for reproduction

to setup
  clear-all
  set-default-shape bugs "bug"
  create-bugs 250 [ set color red  set threshold 5 ]     ; simple (efficient) species
  create-bugs 250 [ set color blue  set threshold 20 ]   ; complex species (4*size of simple)
  ask patches [ if random-float 100 < 15 [ set pcolor green ] ]
  ask bugs [ setxy random-xcor random-ycor  set energy random 10  set efficiency 0.4 ]
  reset-ticks
end 

to go
  grow-grass
  if not any? bugs with [color = red] [ stop ]
  if not any? bugs with [color = blue] [ stop ]
  if count bugs > 1000 [ stop ]
  ask bugs  [move   eat-grass   if energy > threshold [reproduce]   death]
  tick
end 

to grow-grass
;  ask patches [ if pcolor = black [ if random-float 1000 < 15 [ set pcolor green ] ] ]
  ask patches [ if pcolor = black and random-float 1000 < 15 [ set pcolor green ] ]
end 

to move                                                           ; moving takes energy
  rt random 50 lt random 50 fd 1    set energy energy - 0.3
end 

to eat-grass                                                      ; bugs gain energy by eating grass
  let penergy 5
  set penergy penergy * efficiency                                ; some bugs get more from plants
  if pcolor = green [ set pcolor black  set energy energy + penergy ]
end 

to reproduce                                                      ; give birth to a new bug
  set energy energy / 2.0                             ; energy expended even if offspring not viable
  let rn random-float 1000
  if color = red [
    if rn <= 1 [                                                  ; produce improved offspring
      hatch 1 [ set efficiency efficiency + 0.05 fd 1 ] ]
    if (rn > 1) and (rn <= 951)                                   ; use cumulative probability
      [ hatch 1 [ fd 1 ] ] ]                                      ; produce clone
  set rn random-float 1000
  if color = blue [
    if rn <= 42 [                                                 ; produce improved offspring
      hatch 1 [ set efficiency efficiency + 0.05 fd 1 ] ]
    if (rn > 42) and (rn <= 952)                                  ; use cumulative probability
      [ hatch 1 [ fd 1 ] ] ]                                      ; produce clone
end 

to death                                                          ; die if all energy consumed
  if energy < 0 [ die ]
end 

There is only one version of this model, created about 6 years ago by Al Pugh.

Attached files

File Type Description Last updated
Complex organism evolution.png preview Preview for 'Complex organism evolution' about 6 years ago, by Al Pugh Download

This model does not have any ancestors.

This model does not have any descendants.