BirdsAndWolves

No preview image

1 collaborator

Default-person Hugo Thierry (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 233 times • Downloaded 15 times • Run 0 times
Download the 'BirdsAndWolves' 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

globals []
breed[trees tree]
breed[birds bird]
breed[snakes snake]
birds-own[countdown movementforce]
snakes-own[countdown]

to setup
  clear-all
  ask patches[
    set pcolor 58
  ]
  create-trees 300
  [
    set shape one-of ["tree"]
    set color green + random 5
    set size 2
    setxy random-xcor random-ycor
  ]

  create-birds 20
  [
   set shape "butterfly"
   set color one-of base-colors
   set size 1
   setxy random-xcor random-ycor
   set countdown random 10
   set movementforce random 10
  ]

  create-snakes 1
  [
    set shape "wolf"
    set color brown
    set size 2.5
    setxy random-xcor random-ycor
    set countdown random 10
  ]
end 

to go
 ask birds [
  ifelse countdown = 0
    [ ifelse movementforce > 0 [
      move-birds
      set movementforce movementforce - 1
      ]
      [set countdown random 150
      set movementforce random 50 ]
    ]

    [set countdown countdown - 1]
  ]
  ask snakes [
    ifelse countdown = 0[
     move-snakes
    ]
    [set countdown countdown - 1]
    kill-birds
  ]
end 

to move-birds
  rt random 50
  lt random 50
  fd 0.2
end 

to move-snakes
  rt random 5
  lt random 5
  fd 0.09
end 

to kill-birds
  let prey one-of birds-here
  if prey != nobody[
    ask prey [die]
    set countdown 100
  ]
end 

There is only one version of this model, created almost 7 years ago by Hugo Thierry.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.