Myself Example

Myself Example preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

(This model has yet to be categorized with any tags)
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 938 times • Downloaded 36 times • Run 5 times
Download the 'Myself Example' 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

to setup
  ca
  crt 50                               ; make  50 turtles
  [
    setxy random-xcor random-ycor      ; scatter them around the world
  ]
end 

; turtle procedure -- find closest turtle and move towards it

to cluster
  ; figure out what turtle, other than ourselves, is closest
  let closest-turtle min-one-of other turtles [distance myself]

  ; now move ourselves towards that turtle
  face closest-turtle
  ; but first "wiggle" a little
  rt random-float 20
  lt random-float 20
  fd 1
end 


; turtle procedure -- make a colored splotch around myself, the same color as me

to splotch
  ask patches in-radius 2 [ set pcolor [color] of myself ]
end 


; turtle procedure -- turn any turtle I encounter the same color as me

to infect
  ask turtles-here [ set color [color] of myself ]
  rt random-float 20
  lt random-float 20
  fd 1
end 


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 9 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky almost 10 years ago Updated version tag Download this version
Uri Wilensky over 10 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 12 years ago Myself Example Download this version
Uri Wilensky over 12 years ago Myself Example Download this version

Attached files

File Type Description Last updated
Myself Example.png preview Preview for 'Myself Example' over 9 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.