Breeds and Shapes Example

Breeds and Shapes 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 1216 times • Downloaded 107 times • Run 2 times
Download the 'Breeds and Shapes 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

Click to Run Model

breed [monsters monster]
breed [fish a-fish]       ;; the word "fish" is both singular and plural,
                          ;; so we need to use something different for
                          ;; the singular form

to setup
  clear-all               ;; clear all patches and turtles
  set-default-shape monsters "monster"  ;; shape is defined in Turtle Shapes Editor
  set-default-shape fish     "fish"     ;; ditto
  ask patches with [pxcor = 0] [        ;; just the middle column of patches
    ifelse random 2 = 0                 ;; flip a coin
      [ sprout-monsters 1 ]
      [ sprout-fish     1 ]
  ]
  ask turtles [           ;; includes both monsters and fish
    set heading 90        ;; face east
  ]
  reset-ticks
end 

to move-monsters
  ask monsters [ fd 1 ]
  tick
end 

to move-fish
  ask fish [ fd 1 ]
  tick
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 Breeds and Shapes Example Download this version
Uri Wilensky over 14 years ago Breeds and Shapes Example Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.