Halo Example

Halo Example preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

code example 

Tagged by Reuven M. Lerner almost 12 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 601 times • Downloaded 100 times • Run 1 time
Download the 'Halo 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

breed [runners runner]
breed [halos halo]

to setup
  clear-all
  ;; the "thin ring" shape was made using the shapes editor;
  ;; it's a simple, unfilled circle
  set-default-shape halos "thin ring"
  create-runners 250
    [ setxy random-xcor random-ycor ]
  reset-ticks
end 

to go
  ask runners [ fd 0.1 ]
  tick
end 

to make-halo  ;; runner procedure
  ;; when you use HATCH, the new turtle inherits the
  ;; characteristics of the parent.  so the halo will
  ;; be the same color as the turtle it encircles (unless
  ;; you add code to change it
  hatch-halos 1
  [ set size 5
    ;; Use an RGB color to make halo three fourths transparent
    set color lput 64 extract-rgb color
    ;; set thickness of halo to half a patch
    __set-line-thickness 0.5
    ;; We create an invisible directed link from the runner
    ;; to the halo.  Using tie means that whenever the
    ;; runner moves, the halo moves with it.
    create-link-from myself
    [ tie
      hide-link ] ]
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 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky about 12 years ago Updated version tag Download this version
Uri Wilensky almost 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 14 years ago Halo Example Download this version
Uri Wilensky over 14 years ago Halo Example Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.