Movie Example

Movie 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 729 times • Downloaded 82 times • Run 0 times
Download the 'Movie 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 [ birds bird ]
breed [ spinners spinner ]

turtles-own [ age ]

;; makes a movie of the model; stops when there are 3000 turtles
;; and exports movie to a file

to make-movie

  ;; prompt user for movie location
  user-message "First, save your new movie file (choose a name ending with .mov)"
  let path user-new-file
  if not is-string? path [ stop ]  ;; stop if user canceled

  ;; run the model
  setup
  movie-start path
  movie-grab-view
  while [ count turtles < 3000 ]
    [ go
      movie-grab-view ]

  ;; export the movie
  movie-close
  user-message (word "Exported movie to " path)
end 

to setup
  clear-all
  create-birds 1
  create-spinner
  reset-ticks
end 

to go
  ask birds
  [ wander
    grow-old
    reproduce ]
  tick
  update-spinner
end 

to grow-old
  set age age + 1
end 

to wander
  rt random-float 90
  fd 1
end 

to reproduce
  if (age > 10 and random 10 > 7)
      [ hatch 2
        [ set color color - 4 + random 10
          set age 0 ]
        die ]
end 

;; make the spinner for the upper right hand corner

to create-spinner
  create-spinners 1
  [ set shape "clock"
    setxy (max-pxcor - 3) (max-pycor - 3)
    set color gray - 1.5
    set size 6
    set heading 0
    set label 0 ]
end 

to update-spinner
  ask spinners
  [ set heading ticks * 30
    set label ticks ]
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 Movie Example Download this version
Uri Wilensky over 14 years ago Movie Example Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.