Starlings bird

Starlings bird preview image

1 collaborator

Avatar_black Leo B (Author)

Tags

birds 

Tagged by Leo B over 11 years ago

starlings 

Tagged by Leo B over 11 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.5 • Viewed 489 times • Downloaded 26 times • Run 0 times
Download the 'Starlings bird' 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?

This section could give a general understanding of what the model is trying to show or explain.

HOW IT WORKS

This section could explain what rules the agents use to create the overall behavior of the model.

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

This section could give some ideas of things for the user to notice while running the model.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

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

Click to Run Model

turtles-own[
 target 
 block?
]

globals[
  TARGET_MOUSE
]
patches-own[
  avaible?
]

to Setup
  ;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
  set TARGET_MOUSE nobody
  ask patches [
   set pcolor green 
   set avaible? true
  ]
  ask n-of number_of_turtles patches [
   sprout 1[
     set color black
     set target nobody
     set block? false
   ] 
  ]
end 

to Go
  every 0 [
  move
  ]
  Mouse-Control
end 

to Mouse-Control
  
  if mouse-down?
  [ 
    ifelse (not Made_Wall?) [
      if TARGET_MOUSE != nobody [ ask TARGET_MOUSE [set pcolor green]]
      set TARGET_MOUSE patch mouse-xcor mouse-ycor
      ask TARGET_MOUSE [set pcolor red]
    ]
    [
      ask patch mouse-xcor mouse-ycor[
        set pcolor grey
        set avaible? false
      ]
    ]
  ]
ask turtles [ set target TARGET_MOUSE ]
end 

to move
  ask turtles[
    set color black
   ifelse (target = nobody) [
     right random 90
     left random 90
    
  ][
  if (not block?) [face target]
  set block? false
  ]

  
  let front (turtle-set ( other turtles in-cone 2 70 ))
  let front_wall (patch-set patches in-cone 2 70 with [not avaible?])
  ifelse (count front = 0 and count front_wall = 0) [fd 0.5]
  [set color blue
    right random 90
    left random 90
    set block? true
     set target nobody]
  
 
  ]
end 

to Reset-target
if TARGET_MOUSE != nobody [ ask TARGET_MOUSE [set pcolor green]]
set TARGET_MOUSE nobody
end 

to Reset-Wall
ask patches [
 set pcolor green
 set avaible? true 
]
end 

There is only one version of this model, created over 11 years ago by Leo B.

Attached files

File Type Description Last updated
Starlings bird.png preview Preview for 'Starlings bird' over 11 years ago, by Leo B Download

This model does not have any ancestors.

This model does not have any descendants.