EmergenceWithPerturbation

EmergenceWithPerturbation preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 318 times • Downloaded 36 times • Run 0 times
Download the 'EmergenceWithPerturbation' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Emergence example: pedestrian flows

AUTHOR

Giangiacomo Bravo

WHAT IS IT?

This model shows the emergence of coherent behaviour starting from simple rules.

HOW IT WORKS

Agents are either red or blue. Red ones move left following straight tracks (grey bands in the simulated space). Blue ones move right. If an agent detects another agent in front of it, it changes its track. Agents reaching the space edge are removed from the simulation and replaced by new ones.

HOW TO USE IT

The setup button sets up the model. The parameter n-agents controls the number of agents in the simulation. The go button starts the simulation.

THINGS TO NOTICE

After e certain number of ticks, agents no longer change their tracks. A coherent pattern of behaviour has emerged, where in each track either all agents move left or all agents move right. This on the basis of simple micro-level rules and without the need of macro-level coordination.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [changes]

breed [walls wall]
breed [pedestrians pedestrian]

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

to setup
  ca
  ask patches [
    ifelse pycor mod 2 = 0 [set pcolor 8] [set pcolor 9]
  ]
  if wall? = true [
    ask patches with [pxcor = max-pxcor / 2 and pycor >= max-pycor / 2 - 1 and pycor <= max-pycor / 2 + 1] [
      sprout-walls 1 [
        set shape "square"
        set size 2
        set color black
      ]
    ]
  ]
  ask n-of n-agents patches with [any? turtles-here = false] [
    sprout-pedestrians 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 pedestrians [
    ifelse any? other turtles-on patch-ahead 1
      [
        ifelse random 2 = 0
          [if ycor < max-pycor [if not any? pedestrians-on patch xcor (ycor + 1) [set ycor ycor + 1 set changes changes + 1]]]
          [if ycor > min-pycor [if not any? pedestrians-on patch xcor (ycor - 1) [set ycor ycor - 1 set changes changes + 1]]]
      ]
      [
        fd 1
      ]
  ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Giangiacomo Bravo about 3 years ago Improced obstacle settings Download this version
Giangiacomo Bravo about 3 years ago Added a wall perturbationg the flow Download this version

Attached files

File Type Description Last updated
EmergenceWithPerturbation.png preview Preview about 3 years ago, by Giangiacomo Bravo Download

Parent: Emergence example: pedestrian flows

This model does not have any descendants.

Graph of models related to 'EmergenceWithPerturbation'