Random Seed Example

Random Seed 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 896 times • Downloaded 61 times • Run 0 times
Download the 'Random Seed 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

;; Use a seed created by the NEW-SEED reporter

to use-new-seed
  let my-seed new-seed            ;; generate a new seed
  output-print word "Generated seed: " my-seed  ;; print it out
  random-seed my-seed             ;; use the new seed
end 

;; Use a seed entered by the user

to use-seed-from-user
  let my-seed read-from-string user-input "Enter a random seed (an integer):"
  output-print word "User-entered seed: " my-seed  ;; print it out
  random-seed my-seed             ;; use the new seed
end 

;; create turtles and assign them shapes randomly

to go
  clear-turtles
  ask patches [ sprout 1 ]
  repeat 50
  [ ask turtles
    [ set shape one-of shapes
      set label shape ]
    display ]
  output-print word "Result: " [(word " < " shape " > ")] of turtles
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 Random Seed Example Download this version
Uri Wilensky over 14 years ago Random Seed Example Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.