MIHS (BS, JC, AP) 7

MIHS (BS, JC, AP) 7 preview image

1 collaborator

Default-person Alex Pritchard (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.3.1 • Viewed 101 times • Downloaded 13 times • Run 0 times
Download the 'MIHS (BS, JC, AP) 7' 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 [rabbits rabbit]
breed [people person]
breed [squirrels squirrel]
turtles-own [energy]

to setup
  clear-all
  setup-patches
  setup-rabbits
  setup-soldiers
  setup-squirrels
  reset-ticks
end 

to setup-patches
  ask patches [ set pcolor black ]
end 

to setup-rabbits
  create-rabbits 15 [ set shape "rabbit" set size 1.5 set energy 15]
  ask turtles [ setxy random-xcor random-ycor ]
end 

to setup-squirrels
  create-squirrels 15 [ set shape "squirrel" set size 1.15 set energy 25]
  ask turtles [ setxy random-xcor random-ycor ]
end 

to setup-soldiers
  create-people 1 [ set shape "person soldier" set size 3.5 set energy 10000]
  ask turtles [ setxy random-xcor random-ycor ]
end 

to move-people
  ask people [
    right random 360
    forward .05
  ]
end 

to move-rabbits
  ask rabbits [
    right random 360
    forward rabbitSpeed
  ]
end 

to move-squirrels
  ask squirrels [
    right random 360
    forward squirrelSpeed
  ]
end 

to go
  move-people
  move-rabbits
  move-squirrels
  hunt
  kill
  reproduce
  tick
end 

to hunt
  ask people [ let prey rabbits in-radius 5
    ask prey [die]
  ]
end 

to kill
  ask people [ let prey squirrels in-radius 5
    ask prey [die]
  ]
end 

to reproduce
  ask squirrels [ if energy >= 8 [ set energy energy / 2 hatch 1 [rt random 360 fd 1 ]]]
  ask rabbits [ if energy >= 10 [ set energy energy / 2 hatch 1 [rt random 360 fd 1 ]]]
end 


There is only one version of this model, created over 7 years ago by Alex Pritchard.

Attached files

File Type Description Last updated
MIHS (BS, JC, AP) 7.png preview Preview for 'MIHS (BS, JC, AP) 7' over 7 years ago, by Alex Pritchard Download

This model does not have any ancestors.

This model does not have any descendants.