thing i did

No preview image

1 collaborator

Default-person Alex C-R (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 180 times • Downloaded 21 times • Run 0 times
Download the 'thing i did' modelDownload this modelEmbed this model

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


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

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

Click to Run Model

turtles-own [energy]

breed [eaten eaten1]
breed [eater eater1]

to setup
  clear-all
  setup-eaten
  setup-eater
  setup-grass
  reset-ticks
end 

to setup-eaten
  create-eaten 5 [set color 54]
  create-eaten 5 [set color 53]
  create-eaten 5 [set color 52]
  ask eaten [setxy random-xcor random-ycor]
  ask eaten [set shape "circle"]
  ask eaten [set energy 10]
end 

to setup-eater
  create-eater 10 [set color red]
  ask eater [setxy random-xcor random-ycor]
  ask eater [set shape "square"]
  ask eater [set energy 10]
end 

to setup-grass
  ask patches [set pcolor 10 - random 2]
  ask patches with [pcolor = 10] [set pcolor 33]
  ask patches with [pcolor = 9] [set pcolor 55]
end 

to go
  if not any? eaten with [color != 54] [ifelse End-After-Evolution-Is-Complete? [output-print "Natural Selection Complete" stop] []]
  go-eaten
  go-eater
  go-grass
  tick
end 

to go-eaten
  ask eaten [move eat-grass eaten-baby death move]
end 

to go-eater
  ask eater [move eat-eaten eater-baby death]
end 

to go-grass
  ask patches [grow-grass]
end 

to move
  right random 50
  left random 50
  forward 1
  set energy energy - .25
end 

to grow-grass
  if random 50 = 1 [set pcolor 55]
end 

to eat-grass
  if pcolor = 55 [set pcolor 33 set energy energy + 2]
end 

to eat-eaten
  let prey one-of eaten-here
  if prey != nobody [ask prey [if color = 54 [if random 10 = 1 [die]]] if random 10 = 1 [set energy energy + 8.5]]
  if prey != nobody [ask prey [if color = 53 [if random 2 = 1 [die]]] if random 2 = 1 [set energy energy + 8.5]]
  if prey != nobody [ask prey [if color = 52 [die]] set energy energy + 8.5]
end 

to eaten-baby
  if energy > 10 [if random 25 = 1 [hatch 2 [set color color set energy 5] set energy 5]]
end 

to eater-baby
  if energy > 10 [if random 25 = 1[hatch 1 [set color red set energy 5] set energy 5]]
end 

to death
  if energy <= 0 [die]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Alex C-R over 4 years ago Added option to let simulation continue and removed "Chaos Mode' Download this version
Alex C-R over 4 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.