Emergence example: pedestrian flows

Emergence example: pedestrian flows preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Parent of 1 model: EmergenceWithPerturbation preview imageEmergenceWithPerturbation
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.3.1 • Viewed 815 times • Downloaded 53 times • Run 0 times
Download the 'Emergence example: pedestrian flows' 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

globals [changes]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup
  ca
  ask patches [
    ifelse pycor mod 2 = 0 [set pcolor 8] [set pcolor 9]
  ]
  ask n-of n-agents patches [
    sprout 1 [
      set shape "person"
      set size 1.2
      ifelse random 2 = 0 [set heading 90 set color blue] [set heading 270 set color red]
    ]
  ]
  reset-ticks
end 

to go
  set changes 0
  move
  tick
  if ticks > 5000 [stop]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to move
  ask turtles [
    ifelse any? other turtles-on patch-ahead 1
      [
        ifelse random 2 = 0
          [if ycor < max-pycor [if not any? turtles-on patch xcor (ycor + 1) [set ycor ycor + 1 set changes changes + 1]]]
          [if ycor > min-pycor [if not any? turtles-on patch xcor (ycor - 1) [set ycor ycor - 1 set changes changes + 1]]]
      ]
      [
        fd 1
      ]
  ]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Giangiacomo Bravo over 2 years ago Reverted to older version Download this version
Giangiacomo Bravo over 2 years ago Introduction of a wall perturbating the flow Download this version
Giangiacomo Bravo over 8 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Emergence example: pedestrian flows.png preview Preview for 'Emergence example: pedestrian flows' over 8 years ago, by Giangiacomo Bravo Download

This model does not have any ancestors.

Children:

Graph of models related to 'Emergence example: pedestrian flows'